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

Igor Zubchenok updated CASSANDRA-10368:
---------------------------------------
    Comment: was deleted

(was: This does not work for me in Cassandra 3.11.1, I get error: `Non-primary 
key columns cannot be restricted in the SELECT statement used for materialized 
view creation (got restrictions on: amount)`

 

 
{code:java}
CREATE TABLE cc_transactions (
    userid text,
    year int,
    month int,
    day int,
    id int,
    amount int,
    card text,
    status text,
    PRIMARY KEY ((userid, year), month, day, id)
);

CREATE MATERIALIZED VIEW suspicious_transactions AS
    SELECT userid, year, month, day, id, amount, card, status
    FROM cc_transactions
    WHERE userid IS NOT NULL AND year IS NOT NULL AND month IS NOT NULL AND day 
IS NOT NULL AND id IS NOT NULL
    AND amount > 1000
    PRIMARY KEY ((userid, year), month, day, id);

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: amount)"
{code}
Is it a bug?

 )

> Support Restricting non-PK Cols in Materialized View Select Statements
> ----------------------------------------------------------------------
>
>                 Key: CASSANDRA-10368
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10368
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL, Materialized Views
>            Reporter: Tyler Hobbs
>            Assignee: Jochen Niebuhr
>            Priority: Minor
>             Fix For: 3.10
>
>         Attachments: 10368-3.8.txt
>
>
> CASSANDRA-9664 allows materialized views to restrict primary key columns in 
> the select statement.  Due to CASSANDRA-10261, the patch did not include 
> support for restricting non-PK columns.  Now that the timestamp issue has 
> been resolved, we can add support for this.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to