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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Triage Needed
    • Priority: Normal
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Legacy/Tools
    • Labels:
      None
    • Platform:
      All
    • Impacts:
      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. temptable.csv
          0.0 kB
          Neophytos Demetriou
        2. temptable2.csv
          0.0 kB
          Neophytos Demetriou

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              neophytosd Neophytos Demetriou
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: