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

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

    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. temptable.csv
          0.0 kB
          Neophytos Demetriou
        2. temptable2.csv
          0.0 kB
          Neophytos Demetriou

        Activity

          People

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

            Dates

              Created:
              Updated: