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

COPY command does not quote map keys

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Duplicate
    • None
    • Legacy/Tools
    • None
    • Cassandra 2.0.5, Linux

    • Low

    Description

      cqlsh:myks> create table test (pk text primary key, props map<ascii, blob>);
      cqlsh:myks> insert into test (pk, props) values ('aaa', {'prop1': 0x1020, 'prop2': 0x4050});
      cqlsh:myks> copy test to 't.csv';
      1 rows exported in 0.056 seconds.
      cqlsh:myks> copy test from 't.csv';
      Bad Request: line 1:74 no viable alternative at input ':'
      Aborting import at record #0 (line 1). Previously-inserted values still present.
      0 rows imported in 0.012 seconds.
      cqlsh:myks>
      

      t.csv:

      # cat t.csv
      aaa,"{prop1: 0x1020, prop2: 0x4050}"
      

      I believe the missing quotes in the CSV file cause INSERT to fail.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ngrigoriev@gmail.com Nikolai Grigoriev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: