{"action":"opened","issue":{"url":"https://api.github.com/repos/scylladb/scylla/issues/646","labels_url":"https://api.github.com/repos/scylladb/scylla/issues/646/labels{/name}","comments_url":"https://api.github.com/repos/scylladb/scylla/issues/646/comments","events_url":"https://api.github.com/repos/scylladb/scylla/issues/646/events","html_url":"https://github.com/scylladb/scylla/issues/646","id":121670776,"number":646,"title":"Frozen collection types are not stored correctly in system tables","user":{"login":"penberg","id":81939,"avatar_url":"https://avatars.githubusercontent.com/u/81939?v=3","gravatar_id":"","url":"https://api.github.com/users/penberg","html_url":"https://github.com/penberg","followers_url":"https://api.github.com/users/penberg/followers","following_url":"https://api.github.com/users/penberg/following{/other_user}","gists_url":"https://api.github.com/users/penberg/gists{/gist_id}","starred_url":"https://api.github.com/users/penberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penberg/subscriptions","organizations_url":"https://api.github.com/users/penberg/orgs","repos_url":"https://api.github.com/users/penberg/repos","events_url":"https://api.github.com/users/penberg/events{/privacy}","received_events_url":"https://api.github.com/users/penberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-11T09:32:58Z","updated_at":"2015-12-11T09:32:58Z","closed_at":null,"body":"If you create a table that has a frozen collection type column, ``DESCRIBE TABLE`` shows the column as non-frozen:\r\n\r\nCassandra:\r\n\r\n```\r\n[cqlsh 5.0.1 | Cassandra 2.1.8 | CQL spec 3.2.0 | Native protocol v3]\r\nUse HELP for help.\r\ncqlsh> CREATE KEYSPACE IF NOT EXISTS cql_test_keyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};\r\ncqlsh> USE cql_test_keyspace;\r\ncqlsh:cql_test_keyspace> CREATE TABLE foo  (k int PRIMARY KEY, l frozen<list<int>>);\r\ncqlsh:cql_test_keyspace> DESCRIBE TABLE foo;\r\n\r\nCREATE TABLE cql_test_keyspace.foo (\r\n    k int PRIMARY KEY,\r\n    l frozen<list<int>>\r\n) WITH bloom_filter_fp_chance = 0.01\r\n    AND caching = '{\"keys\":\"ALL\", \"rows_per_partition\":\"NONE\"}'\r\n    AND comment = ''\r\n    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}\r\n    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}\r\n    AND dclocal_read_repair_chance = 0.1\r\n    AND default_time_to_live = 0\r\n    AND gc_grace_seconds = 864000\r\n    AND max_index_interval = 2048\r\n    AND memtable_flush_period_in_ms = 0\r\n    AND min_index_interval = 128\r\n    AND read_repair_chance = 0.0\r\n    AND speculative_retry = '99.0PERCENTILE';\r\n\r\n```\r\n\r\nScylla:\r\n\r\n```\r\n[cqlsh 5.0.1 | Cassandra 2.1.8 | CQL spec 3.2.0 | Native protocol v3]\r\nUse HELP for help.\r\ncqlsh> DESCRIBE TABLE foo;\r\n\r\nKeyspace None not found.\r\ncqlsh> CREATE KEYSPACE IF NOT EXISTS cql_test_keyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};\r\ncqlsh> USE cql_test_keyspace;\r\ncqlsh:cql_test_keyspace> CREATE TABLE foo  (k int PRIMARY KEY, l frozen<list<int>>);\r\ncqlsh:cql_test_keyspace> DESCRIBE TABLE foo;\r\n\r\nCREATE TABLE cql_test_keyspace.foo (\r\n    k int PRIMARY KEY,\r\n    l list<int>\r\n) WITH bloom_filter_fp_chance = 0.01\r\n    AND caching = '{\"keys\":\"ALL\",\"rows_per_partition\":\"ALL\"}'\r\n    AND comment = ''\r\n    AND compaction = {'class': 'SizeTieredCompactionStrategy'}\r\n    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}\r\n    AND dclocal_read_repair_chance = 0.1\r\n    AND default_time_to_live = 0\r\n    AND gc_grace_seconds = 864000\r\n    AND max_index_interval = 2048\r\n    AND memtable_flush_period_in_ms = 0\r\n    AND min_index_interval = 128\r\n    AND read_repair_chance = 0.0\r\n    AND speculative_retry = '99.0PERCENTILE';\r\n\r\n```\r\n\r\nThe problem is that we store the type of the frozen column incorrectly in the system tables:\r\n\r\nCassandra:\r\n\r\n```\r\ncqlsh> SELECT * FROM system.schema_columns WHERE keyspace_name = 'cql_test_keyspace' AND columnfamily_name = 'foo';\r\n\r\n keyspace_name     | columnfamily_name | column_name | component_index | index_name | index_options | index_type | type          | validator\r\n-------------------+-------------------+-------------+-----------------+------------+---------------+------------+---------------+---------------------------------------------------------------------------------------------------------------------------------\r\n cql_test_keyspace |               foo |           k |            null |       null |          null |       null | partition_key |                                                                                       org.apache.cassandra.db.marshal.Int32Type\r\n cql_test_keyspace |               foo |           l |               0 |       null |          null |       null |       regular | org.apache.cassandra.db.marshal.FrozenType(org.apache.cassandra.db.marshal.ListType(org.apache.cassandra.db.marshal.Int32Type))\r\n```\r\n\r\nScylla:\r\n\r\n```\r\ncqlsh:cql_test_keyspace> SELECT * FROM system.schema_columns WHERE keyspace_name = 'cql_test_keyspace' AND columnfamily_name = 'foo';\r\n\r\n keyspace_name     | columnfamily_name | column_name | component_index | index_name | index_options | index_type | type          | validator\r\n-------------------+-------------------+-------------+-----------------+------------+---------------+------------+---------------+-------------------------------------------------------------------------------------\r\n cql_test_keyspace |               foo |           k |            null |       null |          null |       null | partition_key |                                           org.apache.cassandra.db.marshal.Int32Type\r\n cql_test_keyspace |               foo |           l |               0 |       null |          null |       null |       regular | org.apache.cassandra.db.marshal.ListType(org.apache.cassandra.db.marshal.Int32Type)\r\n\r\n(2 rows)\r\n\r\n```\r\n\r\nThis problem is likely the root cause of https://github.com/scylladb/scylla/issues/580."}}