You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Michael Semb Wever (Jira)" <ji...@apache.org> on 2021/09/07 19:46:00 UTC

[jira] [Updated] (CASSANDRA-16787) Copy from csv file with duration type fields fails to import

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

Michael Semb Wever updated CASSANDRA-16787:
-------------------------------------------
    Fix Version/s:     (was: 4.0.1)
                   4.0.x

> 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: Benjamin Lerer
>            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}
> LA@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.3.4#803005)

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