Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1072

CSV adapter incorrectly parses TIMESTAMP values after noon

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:
      None

      Description

      When querying timestamp data using the CSV adapter, the time is always in A.M.

      for example this input file: EXAMPLE_DATA.csv
      ID:long,START:timestamp,END:timestamp
      1,"2015-12-31 07:15:56","2015-12-31 13:31:21"

      yields this output in sqlline:
      select * from example_data;

      ID START END
      1 2015-12-31 07:15:56 2015-12-31 01:31:21

      The bug appears to be in org.apache.calcite.adapter.csv.CsvEnumerator on lines 59 and 60. The parse formats use 'hh' instead of 'HH' for the hour part.

        Activity

        Hide
        julianhyde Julian Hyde added a comment -

        Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/7b944ade.

        Thanks for the well-researched bug report, Chris Albright; it made it very easy to fix!

        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/7b944ade . Thanks for the well-researched bug report, Chris Albright ; it made it very easy to fix!
        Hide
        julianhyde Julian Hyde added a comment -

        Chris Albright, I only just noticed your pull request, https://github.com/apache/calcite/pull/190. Sorry I didn't see it - I would have liked the git commit record to give you credit for tracking this down and fixing it. I can't change the git commit record now, but I'll give you credit in the release notes.

        Show
        julianhyde Julian Hyde added a comment - Chris Albright , I only just noticed your pull request, https://github.com/apache/calcite/pull/190 . Sorry I didn't see it - I would have liked the git commit record to give you credit for tracking this down and fixing it. I can't change the git commit record now, but I'll give you credit in the release notes.
        Hide
        ChrisAlbright Chris Albright added a comment -

        No worries 😀 I'm glad you were able to fix it with just the bug report.

        Show
        ChrisAlbright Chris Albright added a comment - No worries 😀 I'm glad you were able to fix it with just the bug report.
        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.7.0 (2016-03-22).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.7.0 (2016-03-22).

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            ChrisAlbright Chris Albright
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development