[ https://issues.apache.org/jira/browse/CASSANDRA-19252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brandon Williams updated CASSANDRA-19252: ----------------------------------------- Bug Category: Parent values: Correctness(12982)Level 1 values: API / Semantic Definition(13162) Complexity: Normal Discovered By: User Report Fix Version/s: 4.1.x 5.0.x 5.x Severity: Normal Status: Open (was: Triage Needed) > After upgrading from 3.11.16 to 4.1.3 the CREATE MATERIALIZED VIEW generated > by DESCRIBE KEYSPACE is invalid. > ------------------------------------------------------------------------------------------------------------- > > Key: CASSANDRA-19252 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19252 > Project: Cassandra > Issue Type: Bug > Components: Feature/Materialized Views > Reporter: Frank vissing > Priority: Normal > Fix For: 4.1.x, 5.0.x, 5.x > > > After upgrading from 3.11.16 to 4.1.3 the CREATE MATERIALIZED VIEW generated > by DESCRIBE KEYSPACE is invalid. > Way back when In a 3.11.x cluster we did > {code:java} > CREATE TABLE myks.devices ( > id text, > serial text, > PRIMARY KEY (id) > ); > CREATE MATERIALIZED VIEW myks.devices_by_serial AS > SELECT * > FROM myks.devices > WHERE serial IS NOT NULL > PRIMARY KEY (serial, id) > WITH CLUSTERING ORDER BY (id ASC);{code} > > This was perfectley ok back then as KEY's was assumed NOT NULL > so going trough various upgrades our last upgrade from 3.11.16 to 4.1.3 it is > no longer possible to use the schema generated by DESCRIBE KEYSPACE myks as > this outpts > > {code:java} > CREATE MATERIALIZED VIEW myks.devices_by_serial AS > SELECT * > FROM myks.devices > WHERE serial IS NOT NULL > PRIMARY KEY (serial, id) > WITH CLUSTERING ORDER BY (id ASC);{code} > but this is no longer valid as it is missing 'AND id IS NOT NULL' to be valid > cql. The expected output would be > {code:java} > CREATE MATERIALIZED VIEW myks.devices_by_serial AS > SELECT * > FROM myks.devices > WHERE serial IS NOT NULL AND id IS NOT NULL > PRIMARY KEY (serial, id) > WITH CLUSTERING ORDER BY (id ASC);{code} > There is obviousley no ALTER command that will fix this, but i would have > expected the upgraded DESCRIBE to have made valid cql. > -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org