Re: No columns are defined for Materialized View other than primary key

2017-09-07 Thread kurt greaves
https://issues.apache.org/jira/browse/CASSANDRA-13857 for anyone interested. Appreciate a sanity check on the logic if anyone gets the chance. On 8 September 2017 at 02:14, kurt greaves wrote: > Looks like there are a couple of oversights w.r.t what we allow in the > view statement here. I'm cre

Re: No columns are defined for Materialized View other than primary key

2017-09-07 Thread kurt greaves
Looks like there are a couple of oversights w.r.t what we allow in the view statement here. I'm creating a JIRA and will link it here shortly as soon as I've fleshed out all the details.​

Re: No columns are defined for Materialized View other than primary key

2017-09-07 Thread kurt greaves
He wants the same primary key, but just wants to filter on site_id = 1 at view creation time. seems like a valid and reasonable use case to me, but I would say this case was overlooked when setting the PK restrictions.

Re: No columns are defined for Materialized View other than primary key

2017-09-07 Thread Alex Kotelnikov
;>>>> And just in case, I tried secondary indices on site_id. For such use >>>>> they improve nothing. >>>>> >>>>> >>>>> But things are changing and we realized that we want to get rid of >>>>> clustering key,

Re: No columns are defined for Materialized View other than primary key

2017-09-07 Thread DuyHai Doan
> they improve nothing. >>>> >>>> >>>> But things are changing and we realized that we want to get rid of >>>> clustering key, n. >>>> >>>> DROP MATERIALIZED VIEW users_1; >>>> DROP TABLE users; >>>&g

Re: No columns are defined for Materialized View other than primary key

2017-09-07 Thread Alex Kotelnikov
ing. >>> >>> >>> But things are changing and we realized that we want to get rid of >>> clustering key, n. >>> >>> DROP MATERIALIZED VIEW users_1; >>> DROP TABLE users; >>> >>> CREATE TABLE users ( >>> site_id i

Re: No columns are defined for Materialized View other than primary key

2017-09-07 Thread Alex Kotelnikov
; user_id text, >> data set, >> PRIMARY KEY ((site_id, user_id))); >> >> CREATE MATERIALIZED VIEW users_1 AS >> SELECT site_id, user_id, data >> FROM users >> WHERE site_id = 1 AND user_id IS NOT NULL >> PRIMARY KEY ((site_id, user_id)); >> >>

Re: No columns are defined for Materialized View other than primary key

2017-09-07 Thread sha p
PRIMARY KEY ((site_id, user_id))); >> >> CREATE MATERIALIZED VIEW users_1 AS >> SELECT site_id, user_id, data >> FROM users >> WHERE site_id = 1 AND user_id IS NOT NULL >> PRIMARY KEY ((site_id, user_id)); >> >> And here I get the error I listed in t

Re: No columns are defined for Materialized View other than primary key

2017-09-07 Thread DuyHai Doan
); > > CREATE MATERIALIZED VIEW users_1 AS > SELECT site_id, user_id, data > FROM users > WHERE site_id = 1 AND user_id IS NOT NULL > PRIMARY KEY ((site_id, user_id)); > > And here I get the error I listed in the subject. > InvalidRequest: Error from server: code=2

No columns are defined for Materialized View other than primary key

2017-09-07 Thread Alex Kotelnikov
200 [Invalid query] message="No columns are defined for Materialized View other than primary key" But why? I still expect scans to be faster with MV. It appears to be possible to create a dummy column and using as a clustering key. That's ugly. -- Best Regards, *Alexander Kotel