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

Fix 2i on composite components omissions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.0.0
    • None
    • None
    • Normal

    Description

      There some edge-cases, not covered by CASSANDRA-5125, the attached patch fixes those:

      (Assuming CREATE TABLE test (pk0 int, pk1 int, ck0 int, ck1 int, val int, PRIMARY KEY ((pk0, pk1), ck0, ck1)))

      • could not create a 2i on the first part of a composite partition key (pk0)
      • if created, it couldn't work because of getKeyBounds() returning non-empty bounds
      • could create an index on the first clustering key column (ck0), but it would never actually be triggered on reads
      • queries like SELECT * FROM test WHERE pk0 = x AND pk1 = y AND ck1 = z would throw an exception because COCK.makeIndexColumnNameBuilder() couldn't handle empty provided columnName
      • cqlsh could not describe any of these indexes because it was taking column aliases and key aliases from schema_columnfamilies and not reading them directly from schema_columns (had to do the related refactoring).

      Attachments

        1. 5851.txt
          36 kB
          Aleksey Yeschenko
        2. 5851-extra.txt
          1 kB
          Aleksey Yeschenko

        Issue Links

          Activity

            People

              aleksey Aleksey Yeschenko
              aleksey Aleksey Yeschenko
              Aleksey Yeschenko
              Jonathan Ellis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: