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

desc table output shows key-only index ambiguously

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.1.5
    • None
    • Low

    Description

      When creating a secondary index on a map type, for keys, the DESC TABLE output does not create correct DDL (it omits the keys part). So if someone uses describe to recreate a schema they could end up with a values index instead of a keys index.

      First, create a table and add an index:

      CREATE TABLE test.foo (
          id1 text,
          id2 text,
          categories map<text, text>,
          PRIMARY KEY (id1, id2));
      
      create index on foo(keys(categories));|
      

      Now DESC TABLE and you'll see the incomplete index DDL:

      CREATE TABLE test.foo (
          id1 text,
          id2 text,
          categories map<text, text>,
          PRIMARY KEY (id1, id2)
      ) WITH CLUSTERING ORDER BY (id2 ASC)
      .......................snip..............................................
      CREATE INDEX foo_categories_idx ON test.foo (categories);
      

      Attachments

        Activity

          People

            thobbs Tom Hobbs
            rhatch Russ Hatch
            Tom Hobbs
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: