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

Copy from csv file with duration type fields fails to import

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • 4.0.x
    • Tool/cqlsh
    • None
    • Code
    • Normal
    • Low Hanging Fruit
    • User Report
    • All
    • None

    Description

      Getting error:

      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).
      

      To Reproduce:

      CREATE KEYSPACE users WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1 } AND durable_writes = true;
      
      CREATE TABLE users.user_credentials_by_email (
      email text,
      la_duration duration,
      PRIMARY KEY(email)
      );
      

      create users.csv file with:

      LA@LA.com,8m26s482ms
      

      Run:

      COPY users.user_credentials_by_email FROM 'users.csv' WITH HEADER = FALSE AND NULL='null';
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned Assign to me
            brigesh.dungarakoti Brijesh Dungarakoti

            Dates

              Created:
              Updated:

              Slack

                Issue deployment