Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4200

drill-jdbc-storage: applies timezone to java.sql.Date field and fails

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Description

      When using org.relique.jdbc.csv.CsvDriver to query files with date fields (i.e. 2012-05-01) causes:

      UnsupportedOperationException: Method not supported: ResultSet.getDate(int, Calendar)
      

      In JdbcRecordReader.java:406 there is getDate which tries to apply timezone to java.sql.Date which probably is not timezone related and this brings the error.

      Quick fix is to use ResultSet.getDate(int) instead.

      Details:

      Caused by: java.lang.UnsupportedOperationException: Method not supported: Result
      Set.getDate(int, Calendar)
              at org.relique.jdbc.csv.CsvResultSet.getDate(Unknown Source) ~[csvjdbc-1
      .0-28.jar:na]
              at org.apache.commons.dbcp.DelegatingResultSet.getDate(DelegatingResultS
      et.java:574) ~[commons-dbcp-1.4.jar:1.4]
              at org.apache.commons.dbcp.DelegatingResultSet.getDate(DelegatingResultS
      et.java:574) ~[commons-dbcp-1.4.jar:1.4]
              at org.apache.drill.exec.store.jdbc.JdbcRecordReader$DateCopier.copy(Jdb
      cRecordReader.java:406) ~[drill-jdbc-storage-1.4.0-SNAPSHOT.jar:1.4.0-SNAPSHOT]
              at org.apache.drill.exec.store.jdbc.JdbcRecordReader.next(JdbcRecordRead
      er.java:242) ~[drill-jdbc-storage-1.4.0-SNAPSHOT.jar:1.4.0-SNAPSHOT]
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              k255 Karol Potocki
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: