Chris Albright created CALCITE-1072:
---------------------------------------

             Summary: CSV adapter not parsing timestamps in P.M.
                 Key: CALCITE-1072
                 URL: https://issues.apache.org/jira/browse/CALCITE-1072
             Project: Calcite
          Issue Type: Bug
            Reporter: Chris Albright
            Assignee: Julian Hyde


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 between 
lines 56 and 62:

  static {
    TimeZone gmt = TimeZone.getTimeZone("GMT");
    TIME_FORMAT_DATE = FastDateFormat.getInstance("yyyy-MM-dd", gmt);
    TIME_FORMAT_TIME = FastDateFormat.getInstance("hh:mm:ss", gmt);
    TIME_FORMAT_TIMESTAMP = FastDateFormat.getInstance(
        "yyyy-MM-dd hh:mm:ss", gmt);
  }





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to