6 Replies Latest reply on Dec 2, 2015 10:38 AM by dnicodemus

    Problem with Hive dates

    dnicodemus

      Using Embedded Teiid 8.12.2. Querying a VDB to Hive, we get the error and stack below when trying to select any date field. Can anyone help me understand what is happening here ?

       

      Thanks,

      Dave

       

      2015-11-25 12:31:16,103 WARN PROCESSOR [Worker2_QueryProcessorQueue73] - TEIID30020 Processing exception for request GYK0e2JQPEB+.21 'TEIID30504 /sonar/spider/e0f53211-1554-41a0-92e3-11d64fcdcc2f: Unexpected exception while translating results: Method not supported'. Originally TeiidProcessingException HiveBaseResultSet.java:275. Enable more detailed logging to see the entire stacktrace.

      2015-11-25 12:31:18,662 WARN CONNECTOR [Worker3_QueryProcessorQueue83] - Connector worker process failed for atomic-request=GYK0e2JQPEB+.24.0.14

      org.teiid.translator.TranslatorException: Unexpected exception while translating results: Method not supported

      at org.teiid.translator.jdbc.JDBCQueryExecution.next(JDBCQueryExecution.java:352)

      at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:419)

      at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:220)

      at sun.reflect.GeneratedMethodAccessor468.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:497)

      at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)

      at com.sun.proxy.$Proxy123.more(Unknown Source)

      at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:301)

      at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110)

      at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107)

      at java.util.concurrent.FutureTask.run(FutureTask.java:266)

      at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)

      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)

      at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)

      at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

      at java.lang.Thread.run(Thread.java:745)

      Caused by: java.sql.SQLException: Method not supported

      at org.apache.hive.jdbc.HiveBaseResultSet.getDate(HiveBaseResultSet.java:275)

      at org.teiid.translator.jdbc.JDBCExecutionFactory.retrieveValue(JDBCExecutionFactory.java:1023)

      at org.teiid.translator.hive.BaseHiveExecutionFactory.retrieveValue(BaseHiveExecutionFactory.java:247)

      at org.teiid.translator.jdbc.JDBCQueryExecution.next(JDBCQueryExecution.java:344)

        • 1. Re: Problem with Hive dates
          rareddy

          Dave,

           

          What version of Hive driver you are using? I believe the last version we tested was 0.13 or 0.14.

           

          The workaround with current version is to model your field as string then covert back to date in a view.

           

          Ramesh..

          • 2. Re: Problem with Hive dates
            shawkins

            It doesn't look like the Hive driver supports the get Date/Timestamp methods with Calendar parameters.  We accounted for Timestamp, but not Date in the translator.  So another workaround would be to use the timestamp type.  Can you log an issue for us to not use a Calendar for the Hive getDate call?

            • 3. Re: Problem with Hive dates
              dnicodemus

              Thanks to both of you for the quick response. I'll file a ticket.

               

              We are using the embedded interface of Teiid so we have a lot of control over the translators. Can we override the

               

              public Object retrieveValue(ResultSet results, int columnIndex, Class<?> expectedType) throws SQLException

               

              method of BaseHiveExectuionFactory to include the current check for Time stamp and add one for Date that calls the super's version? Just as you do now for Time stamp?

               

              Thanks,

              Dave

              • 4. Re: Problem with Hive dates
                dnicodemus
                • 5. Re: Problem with Hive dates
                  shawkins

                  > method of BaseHiveExectuionFactory to include the current check for Time stamp and add one for Date that calls the super's version? Just as you do now for Time stamp?

                   

                  Yes, that is needed change.  The fix has been checked in under the issue logged and will be part of 8.12.3/8.13.  Thanks Dave.

                  • 6. Re: Problem with Hive dates
                    dnicodemus

                    Great ! Thanks again.

                    Dave