Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9D93E200B95 for ; Mon, 12 Sep 2016 09:51:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9C3DF160AB8; Mon, 12 Sep 2016 07:51:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DFD0C160AD7 for ; Mon, 12 Sep 2016 09:51:22 +0200 (CEST) Received: (qmail 41408 invoked by uid 500); 12 Sep 2016 07:51:22 -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 41193 invoked by uid 99); 12 Sep 2016 07:51:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Sep 2016 07:51:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id A9B9C2C1B80 for ; Mon, 12 Sep 2016 07:51:21 +0000 (UTC) Date: Mon, 12 Sep 2016 07:51:21 +0000 (UTC) From: "Stefania (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-11534) cqlsh fails to format collections when using aliases MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 12 Sep 2016 07:51:23 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-11534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15483402#comment-15483402 ] Stefania commented on CASSANDRA-11534: -------------------------------------- Thank you for your analysis [~arunkumar]. It is correct, the problem was introduced by CASSANDRA-11274 and it only affects trunk (versions 3.6+). As far as I could see, there is no way to map a column alias to the original column name once the result set is received. So the only way to fix this, short of reverting 11274, is to add the CQL types to the result set, for which we need to change the python driver. Here is a [patch|https://github.com/stef1927/python-driver/commits/11534] for the driver, I can create a pull request if you agree [~aholmber]. Once the bundled driver is updated, we can then apply this patch to cqlsh: |[patch|https://github.com/stef1927/cassandra/commits/11534-cqlsh]|[cqlsh tests|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-11534-cqlsh-cqlsh-tests/]| > cqlsh fails to format collections when using aliases > ---------------------------------------------------- > > Key: CASSANDRA-11534 > URL: https://issues.apache.org/jira/browse/CASSANDRA-11534 > Project: Cassandra > Issue Type: Bug > Reporter: Robert Stupp > Assignee: Stefania > Priority: Minor > > Given is a simple table. Selecting the columns without an alias works fine. However, if the map is selected using an alias, cqlsh fails to format the value. > {code} > create keyspace foo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; > CREATE TABLE foo.foo (id int primary key, m map); > insert into foo.foo (id, m) VALUES ( 1, {1: 'one', 2: 'two', 3:'three'}); > insert into foo.foo (id, m) VALUES ( 2, {1: '1one', 2: '2two', 3:'3three'}); > cqlsh> select id, m from foo.foo; > id | m > ----+------------------------------------- > 1 | {1: 'one', 2: 'two', 3: 'three'} > 2 | {1: '1one', 2: '2two', 3: '3three'} > (2 rows) > cqlsh> select id, m as "weofjkewopf" from foo.foo; > id | weofjkewopf > ----+----------------------------------------------------------------------- > 1 | OrderedMapSerializedKey([(1, u'one'), (2, u'two'), (3, u'three')]) > 2 | OrderedMapSerializedKey([(1, u'1one'), (2, u'2two'), (3, u'3three')]) > (2 rows) > Failed to format value OrderedMapSerializedKey([(1, u'one'), (2, u'two'), (3, u'three')]) : 'NoneType' object has no attribute 'sub_types' > Failed to format value OrderedMapSerializedKey([(1, u'1one'), (2, u'2two'), (3, u'3three')]) : 'NoneType' object has no attribute 'sub_types' > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)