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

Milliseconds are lost when importing with COPY FRΟΜ and an alternative DATETIMEFORMAT

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: Triage Needed
    • Normal
    • Resolution: Unresolved
    • None
    • Legacy/Tools
    • None
    • All
    • None

    Description

      With a table created as follows:

       

      CREATE TABLE rc.temptable(id bigint, recorded_on timestamp, primary key(id));

       

      The following does not work - milliseconds are lost - temptable2.csv is attached:

       

      COPY rc.temptable(id,recorded_on) FROM 'temptable2.csv' WITH ERRFILE = 'temptable.err' AND HEADER = TRUE AND BOOLSTYLE = '1,0' AND DATETIMEFORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'

       

      We have tried with various files/formats and, in essence, we are forced to use the default cassandra format or milliseconds are lost. For instance, using temptable.csv (attached) and the following command (no cqlshrc and no CQLSH_DEFAULT_TIMESTAMP_FORMAT is defined) works fine:

      COPY rc.temptable(id,recorded_on) FROM 'temptable.csv' WITH ERRFILE = 'temptable.err' AND HEADER = TRUE AND BOOLSTYLE = '1,0'

      This is with: cqlsh 5.0.1, Cassandra 3.11.4, CQL spec 3.4.4, Native protocol v4.

      Attachments

        1. temptable2.csv
          0.0 kB
          Neophytos Demetriou
        2. temptable.csv
          0.0 kB
          Neophytos Demetriou

        Activity

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

          People

            Unassigned Unassigned Assign to me
            neophytosd Neophytos Demetriou

            Dates

              Created:
              Updated:

              Slack

                Issue deployment