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

Odata4 translator can't handle conditions on columns which use conversions

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 8.12.11.6_4
    • Fix Version/s: 10.0.4, 10.2, 10.1.2
    • Component/s: OData
    • Labels:
      None

      Description

      Failing query examples, given that BQT1.SmallA is a view backed by the OData4 translator:

      • SELECT bigintegervalue FROM BQT1.SmallA WHERE CONVERT(bigintegervalue, INTEGER) = 1
        • This yields:

          ExampleExceptionFormatter: exception message was: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 odata4: The value type class java.lang.Integer is not supported.
          

      • SELECT stringkey FROM BQT1.SmallA WHERE CONVERT(stringkey, CHAR) = '1'
        • This yields:

          ExampleExceptionFormatter: exception message was: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 odata4: The value type class java.lang.Character is not supported.
          

      Similarly if the conversion is in the DDL:

      CREATE VIEW Simple (
        charvalue char
      ) AS SELECT CONVERT(A.stringkey, CHAR) 
        FROM sourceModel.SmallA AS A;    
      

      Then a query like this SELECT Simple.CharValue FROM BQT1.Simple WHERE CharValue = '1' will fail with the same error.

      Full stack trace:

      07:00:13,946 WARN  [org.teiid.CONNECTOR] (Worker1_QueryProcessorQueue36) Connector worker process failed for atomic-request=ZJj8bD/Hl58m.14.2.4: org.teiid.translator.TranslatorException: The value type class java.lang.Character is not supported.
      	at org.teiid.translator.odata4.ODataFilterVisitor.visit(ODataFilterVisitor.java:311) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.language.Literal.acceptVisitor(Literal.java:48) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.translator.odata4.ODataFilterVisitor.append(ODataFilterVisitor.java:325) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.translator.odata4.ODataFilterVisitor.appendRightComparison(ODataFilterVisitor.java:126) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.translator.odata4.ODataFilterVisitor.visit(ODataFilterVisitor.java:107) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.language.Comparison.acceptVisitor(Comparison.java:110) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.translator.odata4.ODataFilterVisitor.append(ODataFilterVisitor.java:325) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.translator.odata4.ODataFilterVisitor.appendFilter(ODataFilterVisitor.java:72) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.translator.odata4.ODataQuery.processFilter(ODataQuery.java:130) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.translator.odata4.ODataSelectQuery.buildURL(ODataSelectQuery.java:65) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.translator.odata4.ODataSQLVisitor.buildURL(ODataSQLVisitor.java:85) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.translator.odata4.ODataQueryExecution.execute(ODataQueryExecution.java:68) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:361)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_151]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_151]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_151]
      	at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_151]
      	at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
      	at com.sun.proxy.$Proxy91.execute(Unknown Source)
      	at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306)
      	at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
      	at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_151]
      	at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
      	at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:284)
      	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:1149) [rt.jar:1.8.0_151]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151]
      	at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151]
      Caused by: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The value type class java.lang.Character is not supported.
      	at org.apache.olingo.commons.core.edm.primitivetype.EdmBinary.internalValueToString(EdmBinary.java:203) [odata-commons-core-4.4.0-teiid-1.jar:]
      	at org.apache.olingo.commons.core.edm.primitivetype.AbstractPrimitiveType.valueToString(AbstractPrimitiveType.java:86) [odata-commons-core-4.4.0-teiid-1.jar:]
      	at org.teiid.olingo.common.ODataTypeManager.convertToODataURIValue(ODataTypeManager.java:357) [teiid-olingo-common-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	at org.teiid.translator.odata4.ODataFilterVisitor.visit(ODataFilterVisitor.java:309) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
      	... 31 more
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                jmartisk Jan Martiska
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: