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

A java.lang.AssertionError on LanguageBridgeFactory.translate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 15.0.2, 16.0.1, 17.0
    • 15.0.1
    • Query Engine
    • None
    • Hide

      1. Add MySQL (in my case I use adventureworks test database) database configuration in standalone-teiid.xml (adventureworks):

                      <datasource jndi-name="java:/adventureworks" pool-name="adventureworks" enabled="true" use-java-context="true">
                          <connection-url>jdbc:mysql://localhost:3306/adventureworks?zeroDateTimeBehavior=convertToNull</connection-url>
                          <driver>mysql</driver>
                          <new-connection-sql>set SESSION sql_mode = 'ANSI'</new-connection-sql>
                          <pool>
                              <min-pool-size>2</min-pool-size>
                              <max-pool-size>70</max-pool-size>
                          </pool>
                          <security>
                              <user-name>XXXX</user-name>
                              <password>XXXX</password>
                          </security>
                          <validation>
                              <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
                              <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
                          </validation>
                          <timeout>
                              <blocking-timeout-millis>120000</blocking-timeout-millis>
                              <idle-timeout-minutes>5</idle-timeout-minutes>
                          </timeout>
                      </datasource>
      

      2. Add in test-vdb.xml java:/adventureworks configured in previous step as a data source:

          <model name="adventureworks">
              <property name="importer.useFullSchemaName" value="false"/>
              <property name="importer.tableTypes" value="TABLE,VIEW"/>
              <property name="importer.importKeys" value="false"/>
              <source name="adventureworks" translator-name="mylobs" connection-jndi-name="java:/adventureworks"/>
          </model>
      

      3. Run the following script:

      begin
      	declare integer v_id  = 5002;		
      	SELECT 
      	    rsr.salesorderid,
      	    rsr.rowguid
      	    , variables.v_id
      	FROM "adventureworks.salesorderdetail" rsr
      	ORDER BY 
      		--rsr.salesorderid, variables.v_id;
      		-- ok
      		rsr.salesorderid = variables.v_id;
      		-- java.lang.AssertionError
      end ;;
      
      Show
      1. Add MySQL (in my case I use adventureworks test database) database configuration in standalone-teiid.xml (adventureworks): <datasource jndi-name= "java:/adventureworks" pool-name= "adventureworks" enabled= "true" use-java-context= "true" > <connection-url> jdbc:mysql://localhost:3306/adventureworks?zeroDateTimeBehavior=convertToNull </connection-url> <driver> mysql </driver> <new-connection-sql> set SESSION sql_mode = 'ANSI' </new-connection-sql> <pool> <min-pool-size> 2 </min-pool-size> <max-pool-size> 70 </max-pool-size> </pool> <security> <user-name> XXXX </user-name> <password> XXXX </password> </security> <validation> <valid-connection-checker class-name= "org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker" /> <exception-sorter class-name= "org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter" /> </validation> <timeout> <blocking-timeout-millis> 120000 </blocking-timeout-millis> <idle-timeout-minutes> 5 </idle-timeout-minutes> </timeout> </datasource> 2. Add in test-vdb.xml java:/adventureworks configured in previous step as a data source: <model name= "adventureworks" > <property name= "importer.useFullSchemaName" value= "false" /> <property name= "importer.tableTypes" value= "TABLE,VIEW" /> <property name= "importer.importKeys" value= "false" /> <source name= "adventureworks" translator-name= "mylobs" connection-jndi-name= "java:/adventureworks" /> </model> 3. Run the following script: begin declare integer v_id = 5002; SELECT rsr.salesorderid, rsr.rowguid , variables .v_id FROM "adventureworks.salesorderdetail" rsr ORDER BY --rsr.salesorderid, variables .v_id; -- ok rsr.salesorderid = variables .v_id; -- java.lang.AssertionError end ;;
    • Undefined

      When running the sql script:

      begin
      	declare integer v_id  = 5002;		
      	SELECT 
      	    rsr.salesorderid,
      	    rsr.rowguid
      	    , variables.v_id
      	FROM "adventureworks.salesorderdetail" rsr
      	ORDER BY 
      		--rsr.salesorderid, variables.v_id;
      		-- ok
      		rsr.salesorderid = variables.v_id;
      		-- java.lang.AssertionError
      end ;;
      

      Teiid generates the following stacktrace with a java.lang.AssertionError:

      2020-12-23 17:26:51,246 ERROR [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue31) 3JDnTSxK+dqM TEIID30019 Unexpected exception for request 3JDnTSxK+dqM.20: java.lang.AssertionError: org.teiid.query.sql.symbol.Reference VARIABLES.v_id                                                                                                                                         at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:787)                                                             at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:586)                                                             at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:492)                                                             at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:779)                                                             at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:1030)                                                            at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:777)                                                             at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:737)                                                             at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:374)                                                             at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:272)                                                             at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.datamgr.ConnectorWorkItem.<init>(ConnectorWorkItem.java:173)                                                                        at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.datamgr.ConnectorManager.registerRequest(ConnectorManager.java:220)                                                                 at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.process.DataTierManagerImpl.registerRequest(DataTierManagerImpl.java:1304)                                                          at org.jboss.teiid@15.0.1//org.teiid.query.tempdata.TempTableDataManager.registerRequest(TempTableDataManager.java:178)                                                               at org.jboss.teiid@15.0.1//org.teiid.query.processor.proc.ProcedurePlan.registerRequest(ProcedurePlan.java:942)                                                                       at org.jboss.teiid@15.0.1//org.teiid.query.processor.relational.AccessNode.registerRequest(AccessNode.java:507)                                                                       at org.jboss.teiid@15.0.1//org.teiid.query.processor.relational.AccessNode.openInternal(AccessNode.java:273)                                                                          at org.jboss.teiid@15.0.1//org.teiid.query.processor.relational.AccessNode.open(AccessNode.java:174)                                                                                  at org.jboss.teiid@15.0.1//org.teiid.query.processor.relational.RelationalPlan.open(RelationalPlan.java:130)                                                                          at org.jboss.teiid@15.0.1//org.teiid.query.processor.QueryProcessor.init(QueryProcessor.java:227)                                                                                     at org.jboss.teiid@15.0.1//org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:134)                                                                          at org.jboss.teiid@15.0.1//org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:110)                                                                                at org.jboss.teiid@15.0.1//org.teiid.query.processor.BatchIterator.finalRow(BatchIterator.java:65)                                                                                    at org.jboss.teiid@15.0.1//org.teiid.common.buffer.AbstractTupleSource.getCurrentTuple(AbstractTupleSource.java:66)                                                                   at org.jboss.teiid@15.0.1//org.teiid.query.processor.BatchIterator.getCurrentTuple(BatchIterator.java:80)                                                                             at org.jboss.teiid@15.0.1//org.teiid.common.buffer.AbstractTupleSource.hasNext(AbstractTupleSource.java:88)                                                                           at org.jboss.teiid@15.0.1//org.teiid.query.processor.proc.ProcedurePlan.executePlan(ProcedurePlan.java:625)                                                                           at org.jboss.teiid@15.0.1//org.teiid.query.processor.proc.CreateCursorResultSetInstruction.process(CreateCursorResultSetInstruction.java:65)                                          at org.jboss.teiid@15.0.1//org.teiid.query.processor.proc.ProcedurePlan.processProcedure(ProcedurePlan.java:402)                                                                      at org.jboss.teiid@15.0.1//org.teiid.query.processor.proc.ProcedurePlan.nextBatchDirect(ProcedurePlan.java:295)                                                                       at org.jboss.teiid@15.0.1//org.teiid.query.processor.proc.ProcedurePlan.nextBatch(ProcedurePlan.java:267)                                                                             at org.jboss.teiid@15.0.1//org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:147)                                                                          at org.jboss.teiid@15.0.1//org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:110)                                                                                at org.jboss.teiid@15.0.1//org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:160)                                                                            at org.jboss.teiid@15.0.1//org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:142)                                                                            at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:491)                                                                       at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:361)                                                                           at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:43)                                                                              at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:284)                                                                               at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:283)                                                                        at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:124)                                                       at org.jboss.teiid@15.0.1//org.teiid.dqp.internal.process.ThreadReuseExecutor$2.run(ThreadReuseExecutor.java:212)                                                                     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)                                                                                          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)                                                                                          at java.base/java.lang.Thread.run(Thread.java:834)
      

              rhn-engineering-shawkins Steven Hawkins
              dalex005 Dmitrii Pogorelov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: