4 Replies Latest reply on Jul 3, 2014 1:04 AM by Joseph CHIDIAC

    Order by on SubqueryField raise an assert error

    Joseph CHIDIAC Novice

      Hi,

      I have the Following query based on a simple table testTable contains 2 fields : field1 and measureField

       

      SELECT (

              SELECT SUM(testTable_sub.measureField) AS subField

                FROM testTable testTable_sub

               WHERE (testTable.field1 = testTable_sub.field1)  

               )

                AS sumField

        FROM testTable

      ORDER BY sumField DESC

       

      this query raise an assert Error

      1. java.lang.AssertionError

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:609)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:434)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:348)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:442)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:350)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:245)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:193)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:757)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:595)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:795)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:601)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:572)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:245)

             at org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:167)

             at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.<init>(ConnectorWorkItem.java:152)

             at org.teiid.dqp.internal.datamgr.ConnectorManager.registerRequest(ConnectorManager.java:161)

             at org.teiid.dqp.internal.process.DataTierManagerImpl.registerRequest(DataTierManagerImpl.java:774)

             at org.teiid.query.tempdata.TempTableDataManager.registerRequest(TempTableDataManager.java:175)

             at org.teiid.query.processor.relational.AccessNode.registerRequest(AccessNode.java:475)

             at org.teiid.query.processor.relational.AccessNode.open(AccessNode.java:248)

             at org.teiid.query.processor.relational.RelationalPlan.open(RelationalPlan.java:127)

             at org.teiid.query.processor.QueryProcessor.init(QueryProcessor.java:231)

             at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:138)

             at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)

             at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:159)

             at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:141)

             at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:435)

             at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:320)

             at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)

             at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:248)

             at org.teiid.dqp.internal.process.DQPCore.executeRequest(DQPCore.java:307)



      If i remove the Order by i don't have any error.

      when i debug into the code, i can see that's related to "testTable.field1 = testTable_sub.field1" when translate the Left or the Right to Teiid Expression