You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Nimi Wariboko Jr. (JIRA)" <ji...@apache.org> on 2016/06/02 20:08:59 UTC

[jira] [Updated] (CASSANDRA-11947) Ability to create a Materialized View without primary key column that has '=' relation

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

Nimi Wariboko Jr. updated CASSANDRA-11947:
------------------------------------------
    Description: 
I have a use case where I'd like to create a materialized view where one of the columns is filtered on a '=' relation and the primary key for that materialized view doesn't include that column.

Example:
{code}
CREATE TABLE analytics (
  resourceId text,
  country text,
  date timestamp,
  clicks int,
  PRIMARY KEY(resourceId, date, country)
);

CREATE MATERIALIZED VIEW analytics_ww AS
       SELECT * FROM analytics
       WHERE country = 'WW'
       PRIMARY KEY (resourceId, date);
{code}

This way I can have a table filtered on a high cardinality column, and I don't also have to specify that column, even though I already know thats the only value in the view.

  was:
I have a use case where I'd like to create a materialized view where one of the columns is filtered on a '=' relation and the primary key for that materialized view doesn't include that column.

Example:
{code}
CREATE TABLE analytics (
  resourceId text,
  country text,
  date timestamp,
  clicks int,
  PRIMARY KEY(resourceId, date, country)
);

CREATE MATERIALIZED VIEW analytics_ww AS
       SELECT * FROM analytics
       WHERE country = 'WW'
       PRIMARY KEY (resourceId, date);
{/code}

This way I can have a table filtered on a high cardinality column, and I don't also have to specify that column, even though I already know thats the only value in the view.


> Ability to create a Materialized View without primary key column that has '=' relation
> --------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-11947
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11947
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Nimi Wariboko Jr.
>
> I have a use case where I'd like to create a materialized view where one of the columns is filtered on a '=' relation and the primary key for that materialized view doesn't include that column.
> Example:
> {code}
> CREATE TABLE analytics (
>   resourceId text,
>   country text,
>   date timestamp,
>   clicks int,
>   PRIMARY KEY(resourceId, date, country)
> );
> CREATE MATERIALIZED VIEW analytics_ww AS
>        SELECT * FROM analytics
>        WHERE country = 'WW'
>        PRIMARY KEY (resourceId, date);
> {code}
> This way I can have a table filtered on a high cardinality column, and I don't also have to specify that column, even though I already know thats the only value in the view.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)