Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-11534

cqlsh fails to format collections when using aliases

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 3.10
    • Legacy/Tools
    • Low

    Description

      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.

      create keyspace foo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
      CREATE TABLE foo.foo (id int primary key, m map<int, text>);
      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'
      

      Attachments

        Issue Links

          Activity

            People

              stefania Stefania Alborghetti
              snazy Robert Stupp
              Stefania Alborghetti
              Robert Stupp
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: