Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5419

timestampadd(SQL_TSI_QUARTER, 2, date) not working after TEIID-5327

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 11.1, 11.0.1, 10.3.3
    • 10.3
    • Query Engine
    • None
    • Hide

      1.
      Use model bound to Oracle's HR schema

      <model name="oracle_DB">
              <property name="importer.useFullSchemaName" value="true"/>
      	<property name="importer.tableTypes" value="TABLE,VIEW"/>
              <property name="importer.schemaPattern" value="HR"/>
              <source name="oracleDB" translator-name="oracle" connection-jndi-name="java:/OracleHRDS"/>
          </model>
      

      2.
      In Squirrel execute query

      select hire_date, timestampadd(SQL_TSI_QUARTER, 2, hire_date) from HR.employees where employee_id = 100
      

      3.

      See the stacktrace

      18:25:34,161 WARN  [org.teiid.CONNECTOR] (Worker2_QueryProcessorQueue41) 4XerK04E52C+ Connector worker process failed for atomic-request=4XerK04E52C+.16.0.2: org.teiid.translator.jdbc.JDBCExecutionException: 1873 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."HIRE_DATE", g_0."HIRE_DATE" + (INTERVAL '182' DAY) FROM "HR"."EMPLOYEES" g_0 WHERE g_0."EMPLOYEE_ID" = 100]
              at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:127)
              at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:382)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:229)
              at com.sun.proxy.$Proxy36.execute(Unknown Source)
              at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:302)
              at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
              at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:104)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:61)
              at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
              at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
              at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: java.sql.SQLDataException: ORA-01873: the leading precision of the interval is too small
      
              at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
              at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
              at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
              at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
              at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
              at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
              at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205)
              at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861)
              at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1145)
              at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267)
              at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
              at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3493)
              at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
              at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:504)
              at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:119)
              ... 18 more
      
      Show
      1. Use model bound to Oracle's HR schema <model name= "oracle_DB" > <property name= "importer.useFullSchemaName" value= "true" /> <property name= "importer.tableTypes" value= "TABLE,VIEW" /> <property name= "importer.schemaPattern" value= "HR" /> <source name= "oracleDB" translator-name= "oracle" connection-jndi-name= "java:/OracleHRDS" /> </model> 2. In Squirrel execute query select hire_date, timestampadd(SQL_TSI_QUARTER, 2, hire_date) from HR.employees where employee_id = 100 3. See the stacktrace 18:25:34,161 WARN [org.teiid.CONNECTOR] (Worker2_QueryProcessorQueue41) 4XerK04E52C+ Connector worker process failed for atomic-request=4XerK04E52C+.16.0.2: org.teiid.translator.jdbc.JDBCExecutionException: 1873 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."HIRE_DATE", g_0."HIRE_DATE" + (INTERVAL '182' DAY) FROM "HR"."EMPLOYEES" g_0 WHERE g_0."EMPLOYEE_ID" = 100] at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:127) at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:382) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:229) at com.sun.proxy.$Proxy36.execute(Unknown Source) at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:302) at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108) at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:104) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:61) at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277) at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115) at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.sql.SQLDataException: ORA-01873: the leading precision of the interval is too small at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205) at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1145) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3493) at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491) at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:504) at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:119) ... 18 more

      After adding support for timestampadd() pushdown to Oracle in TEIID-5327 - Oracle is throwing errors for some pushed queries

              rhn-engineering-shawkins Steven Hawkins
              isemenov_jira Ivan Semenov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: