[ 
https://issues.apache.org/jira/browse/CASSANDRA-16787?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brad Schoening reassigned CASSANDRA-16787:
------------------------------------------

    Assignee: Brad Schoening

> Copy from csv file with duration type fields fails to import
> ------------------------------------------------------------
>
>                 Key: CASSANDRA-16787
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16787
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tool/cqlsh
>            Reporter: Brijesh Dungarakoti
>            Assignee: Brad Schoening
>            Priority: Normal
>             Fix For: 4.0.x
>
>         Attachments: error_cassandra_copy_from_1.JPG, 
> error_cassandra_copy_from_2.JPG
>
>
> Getting error:
> {code:java}
> cqlsh> COPY users.user_credentials_by_email FROM '/home/ubuntu/users.csv' 
> WITH HEADER = FALSE AND NULL='null';
> Using 3 child processes
> Starting copy of users.user_credentials_by_email with columns [email, 
> la_duration].
> Failed to make batch statement: Received an argument of invalid type for 
> column "la_duration". Expected: <class 'cassandra.cqltypes.DurationType'>, 
> Got: <type 'str'>; (DurationType arguments must be a Duration.)_
> Failed to import 1 rows: TypeError - Received an argument of invalid type for 
> column "la_duration". Expected: <class 'cassandra.cqltypes.DurationType'>, 
> Got: <type 'str'>; (DurationType arguments must be a Duration.), given up 
> without retries
> Failed to process 1 rows; failed rows written to 
> import_users_user_credentials_by_email.err
> Processed: 1 rows; Rate: 2 rows/s; Avg. rate: 2 rows/s
> 0 rows imported from 1 files in 0.431 seconds (0 skipped).
> {code}
> *To Reproduce:*
> {code:java}
> CREATE KEYSPACE users WITH replication = {'class': 'NetworkTopologyStrategy', 
> 'datacenter1': '1'} AND durable_writes = true;
> CREATE TABLE users.user_credentials_by_email (
> email text,
> la_duration duration,
> PRIMARY KEY(email)
> );
> {code}
> create users.csv file with:
> {code:java}
> l...@la.com,8m26s482ms
> {code}
> Run:
> {code:java}
> COPY users.user_credentials_by_email FROM '/home/automaton/users.csv' WITH 
> HEADER = FALSE AND NULL='null';
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to