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

Stefan Miklosovic updated CASSANDRA-14942:
------------------------------------------
    Resolution: Cannot Reproduce
        Status: Resolved  (was: Open)

I can not reproduce this in 3.11.15-SNAPSHOT.

{code}
cqlsh> select extensions from system_schema.tables where keyspace_name = 'ks'; 
DESC KEYSPACE ks;
@ Row 1
------------+--------------------
 extensions | {'key1': 0x666f6f}

(1 rows)

CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': '1'}  AND durable_writes = true;

CREATE TABLE ks.cf (
    id text PRIMARY KEY,
    a int
) WITH bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = ''
    AND compaction = {'class': 
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 
'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE';

cqlsh> 

{code}

> 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: Low
>              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
(v8.20.10#820010)

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

Reply via email to