Cassandra
  1. Cassandra
  2. CASSANDRA-4129

Cannot create keyspace with specific keywords through cli

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Fix Version/s: 1.0.10
    • Component/s: None
    • Labels:
      None

      Description

      Keyspaces cannot be create when the keyspace name which are used as keywords in the cli, such as 'keyspace', 'family' etc., through CLI. Even when surrounding the keyspace with quotation does not solve the problem. However, such keyspaces can be created through other client such as Hector.

      This is similar to the issue CASSANDRA-3195, in which the column families could not be created. Similar to the solution of CASSANDRA-3195, using String keyspaceName = CliUtil.unescapeSQLString(statement.getChild(0).getText()) in executeAddKeySpace would solve the problem.

      1. CASSANDRA-4129.patch
        1 kB
        Pavel Yaskevich

        Activity

        Hide
        Manoj Mainali added a comment -

        To be more specific, creating keyspaces like 'create keyspace keyspace' or 'create keyspace 'keyspace'' or 'create keyspace family' would fail and raise syntax error error.

        Show
        Manoj Mainali added a comment - To be more specific, creating keyspaces like 'create keyspace keyspace' or 'create keyspace 'keyspace'' or 'create keyspace family' would fail and raise syntax error error.
        Hide
        Jonathan Ellis added a comment -

        cli keywords must be quoted

        Show
        Jonathan Ellis added a comment - cli keywords must be quoted
        Hide
        Manoj Mainali added a comment -

        For keyspace creation quotation, both single and double, does not work.

        Here is a sample of error I get when creating keyspace

        [default@unknown]create keyspace 'column';
        Invalid keyspace name: 'column'

        [default@unknown]create keyspace "column";
        Syntax error at position 16: unexpected """ for `create keyspace "column";`.

        Using quotation works for cf, but not for ks. Anything specific I need to do?

        Show
        Manoj Mainali added a comment - For keyspace creation quotation, both single and double, does not work. Here is a sample of error I get when creating keyspace [default@unknown] create keyspace 'column'; Invalid keyspace name: 'column' [default@unknown] create keyspace "column"; Syntax error at position 16: unexpected """ for `create keyspace "column";`. Using quotation works for cf, but not for ks. Anything specific I need to do?
        Hide
        Pavel Yaskevich added a comment -

        patch against cassandra-1.0

        Show
        Pavel Yaskevich added a comment - patch against cassandra-1.0
        Hide
        Jonathan Ellis added a comment -

        +1

        Show
        Jonathan Ellis added a comment - +1
        Hide
        Pavel Yaskevich added a comment -

        Committed.

        Show
        Pavel Yaskevich added a comment - Committed.

          People

          • Assignee:
            Pavel Yaskevich
            Reporter:
            Manoj Mainali
            Reviewer:
            Jonathan Ellis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development