[ 
https://issues.apache.org/jira/browse/CASSANDRA-13956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16205669#comment-16205669
 ] 

Kurt Greaves commented on CASSANDRA-13956:
------------------------------------------

See CASSANDRA-13798. This was done on purpose. If you absolutely do need it and 
can handle potential problems, there is a JVM property you can set to enable 
this functionality.

> Cannot restrict columns on materialized view
> --------------------------------------------
>
>                 Key: CASSANDRA-13956
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13956
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Materialized Views
>         Environment: [cqlsh 5.0.1 | Cassandra 3.11.1 | CQL spec 3.4.4 | 
> Native protocol v4]
>            Reporter: Chema Vinacua
>             Fix For: 3.11.1
>
>
> After upgrading from 3.11.0 to 3.11.1 I cannot define materialized views 
> restricted on non primary key columns.
> I get: InvalidRequest: Error from server: code=2200 [Invalid query] 
> message="Non-primary key columns cannot be restricted in the SELECT statement 
> used for materialized view creation (got restrictions on: d_destination_set)"
> In my 3.11.0 cluster:
> $ cqlsh ******
> Connected to Test Cluster at ********:9042.
> [cqlsh 5.0.1 | Cassandra 3.11.0 | CQL spec 3.4.4 | Native protocol v4]
> Use HELP for help.
> cqlsh>   CREATE TABLE phoenix.test_table (
>    ...     datetime_bucket         ascii primary key,
>    ...     d_destination_set       boolean,
>    ...     d_destination_timestamp timestamp
>    ...   );
> cqlsh> CREATE MATERIALIZED VIEW phoenix.test_view AS
>    ...   SELECT datetime_bucket,
>    ...          d_destination_set
>    ...     FROM phoenix.test_table
>    ...     WHERE datetime_bucket IS NOT NULL
>    ...       AND d_destination_set = FALSE
>    ... PRIMARY KEY (datetime_bucket, d_destination_set);
> cqlsh> 
> No errors shown here.
> In my 3.11.1 cluster:
> cqlsh>   CREATE TABLE phoenix.test_table (
>    ...     datetime_bucket         ascii primary key,
>    ...     d_destination_set       boolean,
>    ...     d_destination_timestamp timestamp
>    ...   );
> cqlsh> CREATE MATERIALIZED VIEW phoenix.test_view AS
>    ...   SELECT datetime_bucket,
>    ...          d_destination_set
>    ...     FROM phoenix.test_table
>    ...     WHERE datetime_bucket IS NOT NULL
>    ...       AND d_destination_set = FALSE
>    ... PRIMARY KEY (datetime_bucket, d_destination_set);
> InvalidRequest: Error from server: code=2200 [Invalid query] 
> message="Non-primary key columns cannot be restricted in the SELECT statement 
> used for materialized view creation (got restrictions on: d_destination_set)"



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to