You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have a small database with like 30 tables (and no data almost) i run cqlsh DESC SCHEMA it exports a schema file.
everything seems ok.
but after i try to restore this schema with cqlsh -f /exported_schema.cql for some tables (the one with extra indexes) i get this error
Error from server: code=2200 [Invalid query] message="Unknown column name detected in CREATE MATERIALIZED VIEW statement: idx_token"
the point of issues is, why the tool generates this code in first place? and this happens after everything is in scylla so has nothing to do with some legacy tables.
if everything is correct exported schemas (on the same server/version) shouldn't cause any warnings because they were filtered before serialization.
maybe this will help to understand the issue, my old cassandra table definition (but this table was reimported long ago so the schema now is different)
"CREATE TABLE IF NOT EXISTS passrecovery (" +
" h text, " + // hash
" u bigint," + // user
" PRIMARY KEY(h)" +
")"
"CREATE INDEX IF NOT EXISTS ON passrecovery (u);"
and here is what the tool exports
CREATE TABLE dr_1.passrecovery (
h text PRIMARY KEY,
u bigint
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'sstable_compression': '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 = '99.0PERCENTILE';
CREATE INDEX passrecovery_u_idx ON dr_1.passrecovery (u);
CREATE MATERIALIZED VIEW dr_1.passrecovery_u_idx_index AS
SELECT u, idx_token, h
FROM dr_1.passrecovery
WHERE u IS NOT NULL
PRIMARY KEY (u, idx_token, h)
WITH CLUSTERING ORDER BY (idx_token ASC, h ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.0
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 = '99.0PERCENTILE';
The text was updated successfully, but these errors were encountered:
i have a small database with like 30 tables (and no data almost) i run cqlsh DESC SCHEMA it exports a schema file.
everything seems ok.
but after i try to restore this schema with cqlsh -f /exported_schema.cql for some tables (the one with extra indexes) i get this error
Error from server: code=2200 [Invalid query] message="Unknown column name detected in CREATE MATERIALIZED VIEW statement: idx_token"
the point of issues is, why the tool generates this code in first place? and this happens after everything is in scylla so has nothing to do with some legacy tables.
if everything is correct exported schemas (on the same server/version) shouldn't cause any warnings because they were filtered before serialization.
maybe this will help to understand the issue, my old cassandra table definition (but this table was reimported long ago so the schema now is different)
"CREATE TABLE IF NOT EXISTS passrecovery (" +
" h text, " + // hash
" u bigint," + // user
" PRIMARY KEY(h)" +
")"
"CREATE INDEX IF NOT EXISTS ON passrecovery (u);"
and here is what the tool exports
CREATE TABLE dr_1.passrecovery (
h text PRIMARY KEY,
u bigint
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'sstable_compression': '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 = '99.0PERCENTILE';
CREATE INDEX passrecovery_u_idx ON dr_1.passrecovery (u);
CREATE MATERIALIZED VIEW dr_1.passrecovery_u_idx_index AS
SELECT u, idx_token, h
FROM dr_1.passrecovery
WHERE u IS NOT NULL
PRIMARY KEY (u, idx_token, h)
WITH CLUSTERING ORDER BY (idx_token ASC, h ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.0
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 = '99.0PERCENTILE';
The text was updated successfully, but these errors were encountered: