Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-13956

Cannot restrict columns on materialized view

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Not A Problem
    • 3.11.1
    • None
    • [cqlsh 5.0.1 | Cassandra 3.11.1 | CQL spec 3.4.4 | Native protocol v4]

    • Normal

    Description

      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)"

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned Assign to me
            cvinacua Chema Vinacua
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment