Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-13627

Index queries are rejected on COMPACT tables

    XMLWordPrintableJSON

Details

    • 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));
      
          }

      Attachments

        Activity

          People

            blerer Benjamin Lerer
            blerer Benjamin Lerer
            Benjamin Lerer
            Andres de la Peña
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: