Conversation
erikschlegel
left a comment
There was a problem hiding this comment.
whats the motivation behind re-arranging the PKs for pipelinekey, externalsourceid?
|
@erikschlegel This PR is essentially just moving all the keys on which we do a range query (like For example, this will not work: CREATE TABLE foo (
col1 text,
col2 text,
col3 int,
col4 int,
PRIMARY KEY ((col1), col3, col4, col2)
);
SELECT *
FROM foo
WHERE col1='a'
AND col2='b'
AND (col3, col4) <= (10, 10)
AND (col3, col4) >= (0, 0);However, the query would work with this table definition since all the point query columns ( CREATE TABLE foo (
col1 text,
col2 text,
col3 int,
col4 int,
PRIMARY KEY ((col1), col2, col3, col4)
);So the motivating for moving the |
If we want to query some columns in a cluster key by an equals relationship (e.g. `externalsourceid = 'aljazeera'`) and others by a non-equals relationship (e.g. `(tilex, tiley) <= (1, 1)`) then all the equals columns have to come before all the non-equals columns, otherwise we get an error like this: ``` InvalidRequest: Error from server: code=2200 [Invalid query] message="PRIMARY KEY column "pipelinekey" cannot be restric ted (preceding column "tilex" is restricted by a non-EQ relation)" ```
Fix a few IDEA inspections
…layname Display pretty name for sources if available
If we want to query some columns in a cluster key by an equals relationship (e.g.
externalsourceid = 'aljazeera') and others by a non-equals relationship (e.g.(tilex, tiley) <= (1, 1)) then all the equals columns have to come before all the non-equals columns, otherwise we get an error like this: