Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Correctness - API / Semantic Implementation
-
Normal
Description
Since 3.0, compact tables are using under the hood static columns. Due to that SELECT queries using secondary indexes get rejected with the following error:
Queries using 2ndary indexes don't support selecting only static columns.
This problem can be reproduced using the following unit test:
@Test public void testIndicesOnCompactTable() throws Throwable { createTable("CREATE TABLE %s (pk int PRIMARY KEY, v int) WITH COMPACT STORAGE"); createIndex("CREATE INDEX ON %s(v)"); execute("INSERT INTO %S (pk, v) VALUES (?, ?)", 1, 1); execute("INSERT INTO %S (pk, v) VALUES (?, ?)", 2, 1); execute("INSERT INTO %S (pk, v) VALUES (?, ?)", 3, 3); assertRows(execute("SELECT pk, v FROM %s WHERE v = 1"), row(1, 1), row(2, 1)); }