cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Quentin Ambard (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-12959) copy from csv import wrong values with udt having set when fields are not specified on correct order in csv
Date Sun, 27 Nov 2016 17:04:58 GMT
Quentin Ambard created CASSANDRA-12959:
------------------------------------------

             Summary: copy from csv import wrong values with udt having set when fields are
not specified on correct order in csv
                 Key: CASSANDRA-12959
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12959
             Project: Cassandra
          Issue Type: Bug
          Components: CQL
         Environment: tested on cassandra 3.8
            Reporter: Quentin Ambard


 {quote}
create KEYSPACE test WITH replication = \{ 'class': 'SimpleStrategy', 'replication_factor':
1\};

CREATE TYPE test.my_udt (
    first_field text,
    second_field frozen<set<text>>
);

CREATE TABLE test.test ( key text, value my_udt, PRIMARY KEY (key));
{quote}

The following works as expected : 
{quote}
INSERT INTO test.test (key , value ) VALUES ( 'key1', \{second_field: \{'test1', 'test2'\},
first_field: 'first_field'\});

 key  | value
------+----------------------------------------------------------------
 key1 | \{first_field: 'first_field', second_field: \{'test1', 'test2'\}\}
{quote}

but when inserted using a .csv the result is wrong:

{quote}"key1","\{second_field: \{'test1', 'test2'\}, first_field: 'first_field'\}"

COPY test.test FROM '~/test.csv';

 key  | value
------+----------------------------------------------------------------------
 key1 | \{first_field: '\{''test1'', ''test2''\}', second_field: \{'irst_fiel'\}\}
{quote}

it works as expected if the keys are in order: 
bq. "key1","\{first_field: 'first_field', second_field: \{'test1', 'test2'\}\}")



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message