[ 
https://issues.apache.org/jira/browse/CASSANDRA-14942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

C. Scott Andreas updated CASSANDRA-14942:
-----------------------------------------
    Component/s:     (was: Legacy/CQL)
                 Tool/cqlsh

> cqlsh cannot describe keyspace when having table schema extensions
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-14942
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14942
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tool/cqlsh
>         Environment: Cassandra 3.11.3
> The issue comes from the cqlsh utility, in cassandra/metadata.py, function 
> _all_as_cql, viewkeys is not known. 
>  
>  
>            Reporter: vincent royer
>            Priority: Minor
>              Labels: cqlsh
>
> When adding a schema table extension to a table, cqlsh failed to describe 
> keyspace or table with the following error message: 'module' object has no 
> attribute 'viewkeys'
> Step to reproduce the issue:
> {{docker run --name some-cassandra -d docker.io/cassandra:3.11.3}}{{docker 
> exec -it <container_id> cqlsh <<EOF}}
> {{CREATE KEYSPACE ks WITH replication = \{'class': 'SimpleStrategy', 
> 'replication_factor': 1};}}
> {{CREATE TABLE ks.cf (id text PRIMARY KEY , a int);}}
> {{INSERT INTO system_schema.tables (keyspace_name, table_name, extensions ) 
> VALUES ( 'ks','cf',\{'key1':textAsBlob('foo')});}}
> {{EOF}}
>  
> {{docker exec -it <container_id> cqlsh -e "DESC KEYSPACE ks"}}
> {{'module' object has no attribute 'viewkeys'}}
>  
> docker exec -it c75a002959e2 cqlsh --debug -e "DESC KEYSPACE ks"
> Using CQL driver: <module 'cassandra' from 
> '/usr/share/cassandra/lib/cassandra-driver-internal-only-3.11.0-bb96859b.zip/cassandra-driver-3.11.0-bb96859b/cassandra/__init__.py'>
> Using connect timeout: 5 seconds
> Using 'utf-8' encoding
> Using ssl: False
> Traceback (most recent call last):
>  File "/usr/bin/cqlsh.py", line 925, in onecmd
>  self.handle_statement(st, statementtext)
>  File "/usr/bin/cqlsh.py", line 962, in handle_statement
>  return custom_handler(parsed)
>  File "/usr/bin/cqlsh.py", line 1545, in do_describe
>  self.describe_keyspace(ksname)
>  File "/usr/bin/cqlsh.py", line 1281, in describe_keyspace
>  self.print_recreate_keyspace(self.get_keyspace_meta(ksname), sys.stdout)
>  File "/usr/bin/cqlsh.py", line 1231, in print_recreate_keyspace
>  out.write(ksdef.export_as_string())
>  File 
> "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.11.0-bb96859b.zip/cassandra-driver-3.11.0-bb96859b/cassandra/metadata.py",
>  line 661, in export_as_string
>  + [t.export_as_string() for t in self.tables.values()])
>  File 
> "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.11.0-bb96859b.zip/cassandra-driver-3.11.0-bb96859b/cassandra/metadata.py",
>  line 1116, in export_as_string
>  ret = self._all_as_cql()
>  File 
> "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.11.0-bb96859b.zip/cassandra-driver-3.11.0-bb96859b/cassandra/metadata.py",
>  line 1135, in _all_as_cql
>  for k in six.viewkeys(registry) & self.extensions: # no viewkeys on 
> OrderedMapSerializeKey
> AttributeError: 'module' object has no attribute 'viewkeys'
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to