[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-03-28 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic updated CASSANDRA-17266:
--
  Fix Version/s: 4.1
 4.0.4
 (was: 4.0.x)
  Since Version: 4.0.0
Source Control Link: 
https://github.com/apache/cassandra/commit/d0458abdb321a48771631278e3b09dd7aa4e2edc
 Resolution: Fixed
 Status: Resolved  (was: Ready to Commit)

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Assignee: Stefan Miklosovic
>Priority: Normal
>  Labels: lhf
> Fix For: 4.1, 4.0.4
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}
> +Additional Information for newcomers:+
> The code writting the table parameters is in {{TableParams.appendCqlTo}} and 
> is called through {{TableMetadata.appendTableOptions}}. Those method will 
> need to have a new parameter specifying if the call is for a table or a 
> materialized view.
> Some unit test need to be adapted in {{DescribeStatementTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-03-28 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic updated CASSANDRA-17266:
--
Status: Ready to Commit  (was: Review In Progress)

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Assignee: Stefan Miklosovic
>Priority: Normal
>  Labels: lhf
> Fix For: 4.0.x
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}
> +Additional Information for newcomers:+
> The code writting the table parameters is in {{TableParams.appendCqlTo}} and 
> is called through {{TableMetadata.appendTableOptions}}. Those method will 
> need to have a new parameter specifying if the call is for a table or a 
> materialized view.
> Some unit test need to be adapted in {{DescribeStatementTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-03-25 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer updated CASSANDRA-17266:
---
Reviewers: Benjamin Lerer, Brandon Williams, Benjamin Lerer  (was: Benjamin 
Lerer, Brandon Williams)
   Benjamin Lerer, Brandon Williams, Benjamin Lerer  (was: Benjamin 
Lerer, Brandon Williams)
   Status: Review In Progress  (was: Patch Available)

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Assignee: Stefan Miklosovic
>Priority: Normal
>  Labels: lhf
> Fix For: 4.0.x
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}
> +Additional Information for newcomers:+
> The code writting the table parameters is in {{TableParams.appendCqlTo}} and 
> is called through {{TableMetadata.appendTableOptions}}. Those method will 
> need to have a new parameter specifying if the call is for a table or a 
> materialized view.
> Some unit test need to be adapted in {{DescribeStatementTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-03-22 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic updated CASSANDRA-17266:
--
Status: Patch Available  (was: In Progress)

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Assignee: Stefan Miklosovic
>Priority: Normal
>  Labels: lhf
> Fix For: 4.0.x
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}
> +Additional Information for newcomers:+
> The code writting the table parameters is in {{TableParams.appendCqlTo}} and 
> is called through {{TableMetadata.appendTableOptions}}. Those method will 
> need to have a new parameter specifying if the call is for a table or a 
> materialized view.
> Some unit test need to be adapted in {{DescribeStatementTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-03-21 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic updated CASSANDRA-17266:
--
Status: In Progress  (was: Changes Suggested)

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Assignee: Stefan Miklosovic
>Priority: Normal
>  Labels: lhf
> Fix For: 4.0.x
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}
> +Additional Information for newcomers:+
> The code writting the table parameters is in {{TableParams.appendCqlTo}} and 
> is called through {{TableMetadata.appendTableOptions}}. Those method will 
> need to have a new parameter specifying if the call is for a table or a 
> materialized view.
> Some unit test need to be adapted in {{DescribeStatementTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-03-21 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic updated CASSANDRA-17266:
--
Status: Changes Suggested  (was: Review In Progress)

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Assignee: Stefan Miklosovic
>Priority: Normal
>  Labels: lhf
> Fix For: 4.0.x
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}
> +Additional Information for newcomers:+
> The code writting the table parameters is in {{TableParams.appendCqlTo}} and 
> is called through {{TableMetadata.appendTableOptions}}. Those method will 
> need to have a new parameter specifying if the call is for a table or a 
> materialized view.
> Some unit test need to be adapted in {{DescribeStatementTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-01-31 Thread Brandon Williams (Jira)


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

Brandon Williams updated CASSANDRA-17266:
-
Reviewers: Benjamin Lerer, Brandon Williams  (was: Benjamin Lerer)

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Assignee: Yash Ladha
>Priority: Normal
>  Labels: lhf
> Fix For: 4.0.x
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}
> +Additional Information for newcomers:+
> The code writting the table parameters is in {{TableParams.appendCqlTo}} and 
> is called through {{TableMetadata.appendTableOptions}}. Those method will 
> need to have a new parameter specifying if the call is for a table or a 
> materialized view.
> Some unit test need to be adapted in {{DescribeStatementTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-01-26 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer updated CASSANDRA-17266:
---
Reviewers: Benjamin Lerer, Benjamin Lerer  (was: Benjamin Lerer)
   Benjamin Lerer, Benjamin Lerer  (was: Benjamin Lerer)
   Status: Review In Progress  (was: Patch Available)

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Assignee: Yash Ladha
>Priority: Normal
>  Labels: lhf
> Fix For: 4.0.x
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}
> +Additional Information for newcomers:+
> The code writting the table parameters is in {{TableParams.appendCqlTo}} and 
> is called through {{TableMetadata.appendTableOptions}}. Those method will 
> need to have a new parameter specifying if the call is for a table or a 
> materialized view.
> Some unit test need to be adapted in {{DescribeStatementTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-01-26 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer updated CASSANDRA-17266:
---
Reviewers: Benjamin Lerer

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Assignee: Yash Ladha
>Priority: Normal
>  Labels: lhf
> Fix For: 4.0.x
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}
> +Additional Information for newcomers:+
> The code writting the table parameters is in {{TableParams.appendCqlTo}} and 
> is called through {{TableMetadata.appendTableOptions}}. Those method will 
> need to have a new parameter specifying if the call is for a table or a 
> materialized view.
> Some unit test need to be adapted in {{DescribeStatementTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-01-25 Thread Yash Ladha (Jira)


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

Yash Ladha updated CASSANDRA-17266:
---
Test and Documentation Plan: Updated the test to use the new describe 
ouptut and verified by dropping and re-using the output (from describe 
materialized view statement).
 Status: Patch Available  (was: Open)

PR : https://github.com/apache/cassandra/pull/1427

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Assignee: Yash Ladha
>Priority: Normal
>  Labels: lhf
> Fix For: 4.0.x
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}
> +Additional Information for newcomers:+
> The code writting the table parameters is in {{TableParams.appendCqlTo}} and 
> is called through {{TableMetadata.appendTableOptions}}. Those method will 
> need to have a new parameter specifying if the call is for a table or a 
> materialized view.
> Some unit test need to be adapted in {{DescribeStatementTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-01-20 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer updated CASSANDRA-17266:
---
Description: 
Materialized views do not allow default_time_to_live option in CQL (see 
CASSANDRA-12868).

But, if the MV was created without this option, DESCRIBE KEYSPACE / 
MATERIALIZED VIEW command generates CQL that includes it.

E.g.
{code:java}
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': '1'};

USE test;

CREATE TABLE test_table(
  id text,
  date text,
  col1 text,
  col2 text,
  PRIMARY KEY(id,date)
) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);

CREATE MATERIALIZED VIEW test_view AS
SELECT id, date, col1
FROM test_table
WHERE id IS NOT NULL AND date IS NOT NULL
PRIMARY KEY(id, date);{code}
It is OK. 
{code:java}
DESCRIBE MATERIALIZED VIEW test_view; {code}
returns the same CQL + all default options:
{code:java}
CREATE MATERIALIZED VIEW test.test_view AS
    SELECT id, date, col1
    FROM test.test_table
    WHERE id IS NOT NULL AND date IS NOT NULL
    PRIMARY KEY (id, date)
 WITH CLUSTERING ORDER BY (date ASC)
    AND additional_write_policy = '99p'
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND cdc = false
    AND comment = ''
    AND compaction = {'class': 
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '16', 'class': 
'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND default_time_to_live = 0
    AND extensions = {}
    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 = 'BLOCKING'
    AND speculative_retry = '99p';
{code}
Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
re-creating it using DESCRIBE output would fail with 
{noformat}
Cannot set default_time_to_live for a materialized view. Data in a materialized 
view always expire at the same time than the corresponding data in the parent 
table.{noformat}

+Additional Information for newcomers:+

The code writting the table parameters is in {{TableParams.appendCqlTo}} and is 
called through {{TableMetadata.appendTableOptions}}. Those method will need to 
have a new parameter specifying if the call is for a table or a materialized 
view.
Some unit test need to be adapted in {{DescribeStatementTest}} 

  was:
Materialized views do not allow default_time_to_live option in CQL (see 
CASSANDRA-12868).

But, if the MV was created without this option, DESCRIBE KEYSPACE / 
MATERIALIZED VIEW command generates CQL that includes it.

E.g.
{code:java}
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': '1'};

USE test;

CREATE TABLE test_table(
  id text,
  date text,
  col1 text,
  col2 text,
  PRIMARY KEY(id,date)
) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);

CREATE MATERIALIZED VIEW test_view AS
SELECT id, date, col1
FROM test_table
WHERE id IS NOT NULL AND date IS NOT NULL
PRIMARY KEY(id, date);{code}
It is OK. 
{code:java}
DESCRIBE MATERIALIZED VIEW test_view; {code}
returns the same CQL + all default options:
{code:java}
CREATE MATERIALIZED VIEW test.test_view AS
    SELECT id, date, col1
    FROM test.test_table
    WHERE id IS NOT NULL AND date IS NOT NULL
    PRIMARY KEY (id, date)
 WITH CLUSTERING ORDER BY (date ASC)
    AND additional_write_policy = '99p'
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND cdc = false
    AND comment = ''
    AND compaction = {'class': 
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '16', 'class': 
'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND default_time_to_live = 0
    AND extensions = {}
    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 = 'BLOCKING'
    AND speculative_retry = '99p';
{code}
Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
re-creating it using DESCRIBE output would fail with 
{noformat}
Cannot set default_time_to_live for a materialized view. Data in a materialized 
view always expire at the same time than the corresponding data in the parent 
table.{noformat}


> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type

[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-01-20 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer updated CASSANDRA-17266:
---
Complexity: Low Hanging Fruit  (was: Normal)
Labels: lhf  (was: )

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Priority: Normal
>  Labels: lhf
> Fix For: 4.0.x
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-01-18 Thread Brandon Williams (Jira)


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

Brandon Williams updated CASSANDRA-17266:
-
 Bug Category: Parent values: Correctness(12982)
   Complexity: Normal
Discovered By: User Report
Fix Version/s: 4.0.x
 Severity: Low
   Status: Open  (was: Triage Needed)

Tagged this 4.0.x but versions should be examined.

> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Priority: Normal
> Fix For: 4.0.x
>
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(id,date)
> ) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);
> CREATE MATERIALIZED VIEW test_view AS
> SELECT id, date, col1
> FROM test_table
> WHERE id IS NOT NULL AND date IS NOT NULL
> PRIMARY KEY(id, date);{code}
> It is OK. 
> {code:java}
> DESCRIBE MATERIALIZED VIEW test_view; {code}
> returns the same CQL + all default options:
> {code:java}
> CREATE MATERIALIZED VIEW test.test_view AS
>     SELECT id, date, col1
>     FROM test.test_table
>     WHERE id IS NOT NULL AND date IS NOT NULL
>     PRIMARY KEY (id, date)
>  WITH CLUSTERING ORDER BY (date ASC)
>     AND additional_write_policy = '99p'
>     AND bloom_filter_fp_chance = 0.01
>     AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>     AND cdc = false
>     AND comment = ''
>     AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
> 'max_threshold': '32', 'min_threshold': '4'}
>     AND compression = {'chunk_length_in_kb': '16', 'class': 
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
>     AND crc_check_chance = 1.0
>     AND default_time_to_live = 0
>     AND extensions = {}
>     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 = 'BLOCKING'
>     AND speculative_retry = '99p';
> {code}
> Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
> re-creating it using DESCRIBE output would fail with 
> {noformat}
> Cannot set default_time_to_live for a materialized view. Data in a 
> materialized view always expire at the same time than the corresponding data 
> in the parent table.{noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-17266) DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views

2022-01-18 Thread Oleg Zhovtanyuk (Jira)


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

Oleg Zhovtanyuk updated CASSANDRA-17266:

Description: 
Materialized views do not allow default_time_to_live option in CQL (see 
CASSANDRA-12868).

But, if the MV was created without this option, DESCRIBE KEYSPACE / 
MATERIALIZED VIEW command generates CQL that includes it.

E.g.
{code:java}
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': '1'};

USE test;

CREATE TABLE test_table(
  id text,
  date text,
  col1 text,
  col2 text,
  PRIMARY KEY(id,date)
) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);

CREATE MATERIALIZED VIEW test_view AS
SELECT id, date, col1
FROM test_table
WHERE id IS NOT NULL AND date IS NOT NULL
PRIMARY KEY(id, date);{code}
It is OK. 
{code:java}
DESCRIBE MATERIALIZED VIEW test_view; {code}
returns the same CQL + all default options:
{code:java}
CREATE MATERIALIZED VIEW test.test_view AS
    SELECT id, date, col1
    FROM test.test_table
    WHERE id IS NOT NULL AND date IS NOT NULL
    PRIMARY KEY (id, date)
 WITH CLUSTERING ORDER BY (date ASC)
    AND additional_write_policy = '99p'
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND cdc = false
    AND comment = ''
    AND compaction = {'class': 
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '16', 'class': 
'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND default_time_to_live = 0
    AND extensions = {}
    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 = 'BLOCKING'
    AND speculative_retry = '99p';
{code}
Note the 'default_time_to_live = 0' clause! If this veiw is dropped, 
re-creating it using DESCRIBE output would fail with 
{noformat}
Cannot set default_time_to_live for a materialized view. Data in a materialized 
view always expire at the same time than the corresponding data in the parent 
table.{noformat}

  was:
Materialized views do not allow default_time_to_live option in CQL (see 
CASSANDRA-12868).

But, if the MV was created without this option, DESCRIBE KEYSPACE / 
MATERIALIZED VIEW command generates CQL that includes it.

E.g.

 
{code:java}
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': '1'};

USE test;

CREATE TABLE test_table(
  id text,
  date text,
  col1 text,
  col2 text,
  PRIMARY KEY(id,date)
) WITH default_time_to_live = 60 AND CLUSTERING ORDER BY (date DESC);

CREATE MATERIALIZED VIEW test_view AS
SELECT id, date, col1
FROM test_table
WHERE id IS NOT NULL AND date IS NOT NULL
PRIMARY KEY(id, date);{code}
It is OK. 

 

 
{code:java}
DESCRIBE MATERIALIZED VIEW test_view; {code}
returns the same CQL + all default options:

 

 
{code:java}
CREATE MATERIALIZED VIEW test.test_view AS
    SELECT id, date, col1
    FROM test.test_table
    WHERE id IS NOT NULL AND date IS NOT NULL
    PRIMARY KEY (id, date)
 WITH CLUSTERING ORDER BY (date ASC)
    AND additional_write_policy = '99p'
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND cdc = false
    AND comment = ''
    AND compaction = {'class': 
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 
'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '16', 'class': 
'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND default_time_to_live = 0
    AND extensions = {}
    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 = 'BLOCKING'
    AND speculative_retry = '99p';
{code}
Note the 'default_time_to_live = 0' clause!

 

If this veiw is dropped,


> DESCRIBE KEYSPACE / MATERIALIZED VIEW generates invalid CQL for views
> -
>
> Key: CASSANDRA-17266
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17266
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Syntax
>Reporter: Oleg Zhovtanyuk
>Priority: Normal
>
> Materialized views do not allow default_time_to_live option in CQL (see 
> CASSANDRA-12868).
> But, if the MV was created without this option, DESCRIBE KEYSPACE / 
> MATERIALIZED VIEW command generates CQL that includes it.
> E.g.
> {code:java}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'};
> USE test;
> CREATE TABLE test_table(
>   id text,
>   date text,
>   col1 text,
>   col2 text,
>   PRIMARY KEY(i