From commits-return-76490-apmail-cassandra-commits-archive=cassandra.apache.org@cassandra.apache.org Sat Jun 22 11:59:24 2013 Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ECB03C721 for ; Sat, 22 Jun 2013 11:59:23 +0000 (UTC) Received: (qmail 11458 invoked by uid 500); 22 Jun 2013 11:59:23 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 10984 invoked by uid 500); 22 Jun 2013 11:59:21 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 10756 invoked by uid 99); 22 Jun 2013 11:59:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Jun 2013 11:59:20 +0000 Date: Sat, 22 Jun 2013 11:59:20 +0000 (UTC) From: "Aleksey Yeschenko (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-5675) cqlsh shouldn't display "null" for empty values MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-5675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aleksey Yeschenko updated CASSANDRA-5675: ----------------------------------------- Attachment: 5675.txt > cqlsh shouldn't display "null" for empty values > ----------------------------------------------- > > Key: CASSANDRA-5675 > URL: https://issues.apache.org/jira/browse/CASSANDRA-5675 > Project: Cassandra > Issue Type: Bug > Reporter: Sylvain Lebresne > Assignee: Aleksey Yeschenko > Priority: Minor > Fix For: 1.2.7 > > Attachments: 5675.txt > > > For historical reason (and compatibility with thrift), all type support an empty value, even type like int for which it doesn't really make sense (see CASSANDRA-5674 too on that subject). > If you input such an empty value for a type like int, cqlsh will display it as null: > {noformat} > cqlsh:ks> CREATE TABLE test (k text PRIMARY KEY, v int); > cqlsh:ks> INSERT INTO test(k, v) VALUES ('someKey', blobAsInt(0x)); > cqlsh:ks> SELECT * FROM test; > k | v > ---------+------ > someKey | null > {noformat} > But that's not correct, it suggests {{v}} has no value but that's not true, it has a value, it's just an empty one. > Now, one may argue support empty values for a type like int is broken, and I would agree with that. But thrift allows it so we probably need to preserve that behavior for compatibility sake. And I guess the need to use blobAsInt at least make it clear that it's kind of a hack. > That being said, cqlsh should not display null as this is confusing. Instead I'd suggest either displaying nothing (that's how an empty string is displayed after all), or to just go with some random explicit syntax like say "[empty value]" -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira