8 Replies Latest reply on Oct 22, 2015 3:40 PM by Scott Wallace

    Assertion Failed in 8.12, but not 8.11.4

    Scott Wallace Newbie

      Getting assertion failure with the following query pattern in Teiid 8.12, but not 8.11.4


      select column_a, column_b

      from (

         select sum(column_a) as column_a, key_column

         from vdb_a

         group by key_column

      ) a left outer join

      (

        select sum(column_b) as column_b, key_column

        from vdb_b 

        group by key_column

      ) b on a.key_column = b.key_column

      order by column_a desc

      limit 10;


      org.teiid.runtime.client.TeiidClientException: java.lang.RuntimeException: Remote org.teiid.core.TeiidException: Assertion failed.


      This issue appears to be related to the limit clause because when it is removed, I don't get the assertion failure in 8.12.



        • 1. Re: Assertion Failed in 8.12, but not 8.11.4
          Steven Hawkins Master

          Can you open an issue with the full server stack trace?

          • 2. Re: Assertion Failed in 8.12, but not 8.11.4
            Steven Hawkins Master

            I was not able to reproduce with trying a similar scenario, so I'll need more details in the issue - the stack trace and query plan should be sufficient.

            • 3. Re: Assertion Failed in 8.12, but not 8.11.4
              Scott Wallace Newbie

              Stack:

               

              20:06:22,052 ERROR [org.teiid.PROCESSOR] (Worker570_QueryProcessorQueue296723) PLpggDqN87Zm TEIID30019 Unexpected exception for request PLpggDqN87Zm.0: java.lang.AssertionError: Assertion failed.

                at org.teiid.core.util.Assertion.failed(Assertion.java:73) [teiid-common-core-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.core.util.Assertion.assertTrue(Assertion.java:68) [teiid-common-core-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.core.util.Assertion.assertTrue(Assertion.java:60) [teiid-common-core-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.SortUtility.<init>(SortUtility.java:152) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.SortNode.sortPhase(SortNode.java:107) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.SortNode.getBuffer(SortNode.java:206) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.LimitNode.getBuffer(LimitNode.java:211) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.SourceState.getTupleBuffer(SourceState.java:241) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.SourceState.getRowCount(SourceState.java:141) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.EnhancedSortMergeJoinStrategy.shouldIndex(EnhancedSortMergeJoinStrategy.java:347) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.EnhancedSortMergeJoinStrategy.loadRight(EnhancedSortMergeJoinStrategy.java:250) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.JoinNode.nextBatchDirect(JoinNode.java:224) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:278) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.BatchIterator.finalRow(BatchIterator.java:69) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.common.buffer.AbstractTupleSource.getCurrentTuple(AbstractTupleSource.java:70) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.BatchIterator.getCurrentTuple(BatchIterator.java:84) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.common.buffer.AbstractTupleSource.nextTuple(AbstractTupleSource.java:48) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.SortUtility.initialSort(SortUtility.java:262) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.SortUtility.sort(SortUtility.java:196) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.SortNode.sortPhase(SortNode.java:112) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.SortNode.getBuffer(SortNode.java:206) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.LimitNode.getBuffer(LimitNode.java:211) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.ProjectNode.getBuffer(ProjectNode.java:237) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.relational.RelationalPlan.getBuffer(RelationalPlan.java:277) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.QueryProcessor.getBuffer(QueryProcessor.java:289) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:154) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:462) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:344) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:271) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.0.CR1.jar:8.12.0.CR1]

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]

                at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]

              • 4. Re: Assertion Failed in 8.12, but not 8.11.4
                Scott Wallace Newbie

                Plan:

                 

                <?xml version="1.0" encoding="UTF-8"?>

                <node name="ProjectNode">

                   <property name="Relational Node ID">

                      <value>0</value>

                   </property>

                   <property name="Output Columns">

                      <value>dim_key (long)</value>

                      <value>dim_name (string)</value>

                      <value>this_period_measure (bigdecimal)</value>

                      <value>this_period_pct_overall (bigdecimal)</value>

                      <value>last_period_measure (bigdecimal)</value>

                      <value>last_period_pct_overall (bigdecimal)</value>

                   </property>

                   <property name="Statistics">

                      <value>Node Output Rows: 0</value>

                      <value>Node Next Batch Process Time: 0</value>

                      <value>Node Cumulative Next Batch Process Time: 0</value>

                      <value>Node Cumulative Process Time: 0</value>

                      <value>Node Next Batch Calls: 0</value>

                      <value>Node Blocks: 0</value>

                   </property>

                   <property name="Cost Estimates">

                      <value>Estimated Node Cardinality: 10.0</value>

                   </property>

                   <property name="Child 0">

                      <node name="LimitNode">

                         <property name="Relational Node ID">

                            <value>1</value>

                         </property>

                         <property name="Output Columns">

                            <value>dim_key (long)</value>

                            <value>dim_name (string)</value>

                            <value>this_period_measure (bigdecimal)</value>

                            <value>this_period_pct_overall (bigdecimal)</value>

                            <value>last_period_measure (bigdecimal)</value>

                            <value>last_period_pct_overall (bigdecimal)</value>

                         </property>

                         <property name="Statistics">

                            <value>Node Output Rows: 0</value>

                            <value>Node Next Batch Process Time: 0</value>

                            <value>Node Cumulative Next Batch Process Time: 0</value>

                            <value>Node Cumulative Process Time: 0</value>

                            <value>Node Next Batch Calls: 0</value>

                            <value>Node Blocks: 0</value>

                         </property>

                         <property name="Cost Estimates">

                            <value>Estimated Node Cardinality: 10.0</value>

                         </property>

                         <property name="Child 0">

                            <node name="SortNode">

                               <property name="Relational Node ID">

                                  <value>2</value>

                               </property>

                               <property name="Output Columns">

                                  <value>dim_key (long)</value>

                                  <value>dim_name (string)</value>

                                  <value>this_period_measure (bigdecimal)</value>

                                  <value>this_period_pct_overall (bigdecimal)</value>

                                  <value>last_period_measure (bigdecimal)</value>

                                  <value>last_period_pct_overall (bigdecimal)</value>

                               </property>

                               <property name="Statistics">

                                  <value>Node Output Rows: 0</value>

                                  <value>Node Next Batch Process Time: 0</value>

                                  <value>Node Cumulative Next Batch Process Time: 0</value>

                                  <value>Node Cumulative Process Time: 0</value>

                                  <value>Node Next Batch Calls: 0</value>

                                  <value>Node Blocks: 0</value>

                               </property>

                               <property name="Cost Estimates">

                                  <value>Estimated Node Cardinality: -1.0</value>

                               </property>

                               <property name="Child 0">

                                  <node name="JoinNode">

                                     <property name="Relational Node ID">

                                        <value>3</value>

                                     </property>

                                     <property name="Output Columns">

                                        <value>dim_key (long)</value>

                                        <value>dim_name (string)</value>

                                        <value>this_period_measure (bigdecimal)</value>

                                        <value>this_period_pct_overall (bigdecimal)</value>

                                        <value>last_period_measure (bigdecimal)</value>

                                        <value>last_period_pct_overall (bigdecimal)</value>

                                     </property>

                                     <property name="Statistics">

                                        <value>Node Output Rows: 0</value>

                                        <value>Node Next Batch Process Time: 0</value>

                                        <value>Node Cumulative Next Batch Process Time: 0</value>

                                        <value>Node Cumulative Process Time: 0</value>

                                        <value>Node Next Batch Calls: 0</value>

                                        <value>Node Blocks: 0</value>

                                     </property>

                                     <property name="Cost Estimates">

                                        <value>Estimated Node Cardinality: -1.0</value>

                                     </property>

                                     <property name="Child 0">

                                        <node name="LimitNode">

                                           <property name="Relational Node ID">

                                              <value>4</value>

                                           </property>

                                           <property name="Output Columns">

                                              <value>dim_key (long)</value>

                                              <value>dim_name (string)</value>

                                              <value>this_period_measure (bigdecimal)</value>

                                              <value>this_period_pct_overall (bigdecimal)</value>

                                           </property>

                                           <property name="Statistics">

                                              <value>Node Output Rows: 0</value>

                                              <value>Node Next Batch Process Time: 0</value>

                                              <value>Node Cumulative Next Batch Process Time: 0</value>

                                              <value>Node Cumulative Process Time: 0</value>

                                              <value>Node Next Batch Calls: 0</value>

                                              <value>Node Blocks: 0</value>

                                           </property>

                                           <property name="Cost Estimates">

                                              <value>Estimated Node Cardinality: 10.0</value>

                                           </property>

                                           <property name="Child 0">

                                              <node name="SortNode">

                                                 <property name="Relational Node ID">

                                                    <value>5</value>

                                                 </property>

                                                 <property name="Output Columns">

                                                    <value>dim_key (long)</value>

                                                    <value>dim_name (string)</value>

                                                    <value>this_period_measure (bigdecimal)</value>

                                                    <value>this_period_pct_overall (bigdecimal)</value>

                                                 </property>

                                                 <property name="Statistics">

                                                    <value>Node Output Rows: 0</value>

                                                    <value>Node Next Batch Process Time: 0</value>

                                                    <value>Node Cumulative Next Batch Process Time: 0</value>

                                                    <value>Node Cumulative Process Time: 0</value>

                                                    <value>Node Next Batch Calls: 0</value>

                                                    <value>Node Blocks: 0</value>

                                                 </property>

                                                 <property name="Cost Estimates">

                                                    <value>Estimated Node Cardinality: -1.0</value>

                                                 </property>

                                                 <property name="Child 0">

                                                    <node name="ProjectNode">

                                                       <property name="Relational Node ID">

                                                          <value>6</value>

                                                       </property>

                                                       <property name="Output Columns">

                                                          <value>dim_key (long)</value>

                                                          <value>dim_name (string)</value>

                                                          <value>this_period_measure (bigdecimal)</value>

                                                          <value>this_period_pct_overall (bigdecimal)</value>

                                                       </property>

                                                       <property name="Statistics">

                                                          <value>Node Output Rows: 0</value>

                                                          <value>Node Next Batch Process Time: 0</value>

                                                          <value>Node Cumulative Next Batch Process Time: 0</value>

                                                          <value>Node Cumulative Process Time: 0</value>

                                                          <value>Node Next Batch Calls: 0</value>

                                                          <value>Node Blocks: 0</value>

                                                       </property>

                                                       <property name="Cost Estimates">

                                                          <value>Estimated Node Cardinality: -1.0</value>

                                                       </property>

                                                       <property name="Child 0">

                                                          <node name="WindowFunctionProjectNode">

                                                             <property name="Relational Node ID">

                                                                <value>7</value>

                                                             </property>

                                                             <property name="Output Columns">

                                                                <value>expr (bigdecimal)</value>

                                                                <value>expr (bigdecimal)</value>

                                                                <value>dim_key (long)</value>

                                                                <value>dim_name (string)</value>

                                                                <value>measure (bigdecimal)</value>

                                                             </property>

                                                             <property name="Statistics">

                                                                <value>Node Output Rows: 0</value>

                                                                <value>Node Next Batch Process Time: 0</value>

                                                                <value>Node Cumulative Next Batch Process Time: 0</value>

                                                                <value>Node Cumulative Process Time: 0</value>

                                                                <value>Node Next Batch Calls: 0</value>

                                                                <value>Node Blocks: 0</value>

                                                             </property>

                                                             <property name="Child 0">

                                                                <node name="AccessNode">

                                                                   <property name="Relational Node ID">

                                                                      <value>8</value>

                                                                   </property>

                                                                   <property name="Output Columns">

                                                                      <value>dim_key (long)</value>

                                                                      <value>dim_name (string)</value>

                                                                      <value>measure (bigdecimal)</value>

                                                                   </property>

                                                                   <property name="Statistics">

                                                                      <value>Node Output Rows: 0</value>

                                                                      <value>Node Next Batch Process Time: 0</value>

                                                                      <value>Node Cumulative Next Batch Process Time: 0</value>

                                                                      <value>Node Cumulative Process Time: 0</value>

                                                                      <value>Node Next Batch Calls: 0</value>

                                                                      <value>Node Blocks: 0</value>

                                                                   </property>

                                                                   <property name="Cost Estimates">

                                                                      <value>Estimated Node Cardinality: -1.0</value>

                                                                   </property>

                                                                   <property name="Query">

                                                                      <value>SELECT g_0.dim_key, g_1.dim_name, g_0.measure FROM vdb.table AS g_0 INNER JOIN vdb.dim_table AS g_1 ON g_0.dim_key = g_1.dim_key WHERE (g_0.date_key &gt;= '2015-10-01') AND (g_0.date_key &lt;= '2015-10-14') AND (g_0.customer_key = 12345)</value>

                                                                   </property>

                                                                   <property name="Model Name">

                                                                      <value>vdb</value>

                                                                   </property>

                                                                </node>

                                                             </property>

                                                             <property name="Window Functions">

                                                                <value>(PARTITION BY vdb.table.dim_key)</value>

                                                                <value>(PARTITION BY 1)</value>

                                                             </property>

                                                          </node>

                                                       </property>

                                                       <property name="Select Columns">

                                                          <value>vdb.table.dim_key</value>

                                                          <value>vdb.dim_table.dim_name</value>

                                                          <value>SUM(vdb.table.measure) OVER (PARTITION BY vdb.table.dim_key) AS this_period_measure</value>

                                                          <value>((SUM(vdb.table.measure) OVER (PARTITION BY vdb.table.dim_key) / SUM(vdb.table.measure) OVER (PARTITION BY 1)) * 100) AS this_period_pct_overall</value>

                                                       </property>

                                                    </node>

                                                 </property>

                                                 <property name="Sort Columns">

                                                    <value>[SUM(vdb.table.measure) OVER (PARTITION BY vdb.table.dim_key) DESC]</value>

                                                 </property>

                                                 <property name="Sort Mode">

                                                    <value>DUP_REMOVE_SORT</value>

                                                 </property>

                                              </node>

                                           </property>

                                           <property name="Row Offset">

                                              <value>null</value>

                                           </property>

                                           <property name="Row Limit">

                                              <value>10</value>

                                           </property>

                                        </node>

                                     </property>

                                     <property name="Child 1">

                                        <node name="ProjectNode">

                                           <property name="Relational Node ID">

                                              <value>9</value>

                                           </property>

                                           <property name="Output Columns">

                                              <value>dim_key (long)</value>

                                              <value>dim_name (string)</value>

                                              <value>last_period_measure (bigdecimal)</value>

                                              <value>last_period_pct_overall (bigdecimal)</value>

                                           </property>

                                           <property name="Statistics">

                                              <value>Node Output Rows: 0</value>

                                              <value>Node Next Batch Process Time: 0</value>

                                              <value>Node Cumulative Next Batch Process Time: 0</value>

                                              <value>Node Cumulative Process Time: 0</value>

                                              <value>Node Next Batch Calls: 0</value>

                                              <value>Node Blocks: 0</value>

                                           </property>

                                           <property name="Cost Estimates">

                                              <value>Estimated Node Cardinality: -1.0</value>

                                           </property>

                                           <property name="Child 0">

                                              <node name="WindowFunctionProjectNode">

                                                 <property name="Relational Node ID">

                                                    <value>10</value>

                                                 </property>

                                                 <property name="Output Columns">

                                                    <value>expr (bigdecimal)</value>

                                                    <value>expr (bigdecimal)</value>

                                                    <value>dim_key (long)</value>

                                                    <value>dim_name (string)</value>

                                                    <value>measure (bigdecimal)</value>

                                                 </property>

                                                 <property name="Statistics">

                                                    <value>Node Output Rows: 0</value>

                                                    <value>Node Next Batch Process Time: 0</value>

                                                    <value>Node Cumulative Next Batch Process Time: 0</value>

                                                    <value>Node Cumulative Process Time: 0</value>

                                                    <value>Node Next Batch Calls: 0</value>

                                                    <value>Node Blocks: 0</value>

                                                 </property>

                                                 <property name="Child 0">

                                                    <node name="AccessNode">

                                                       <property name="Relational Node ID">

                                                          <value>11</value>

                                                       </property>

                                                       <property name="Output Columns">

                                                          <value>dim_key (long)</value>

                                                          <value>dim_name (string)</value>

                                                          <value>measure (bigdecimal)</value>

                                                       </property>

                                                       <property name="Statistics">

                                                          <value>Node Output Rows: 0</value>

                                                          <value>Node Next Batch Process Time: 0</value>

                                                          <value>Node Cumulative Next Batch Process Time: 0</value>

                                                          <value>Node Cumulative Process Time: 0</value>

                                                          <value>Node Next Batch Calls: 0</value>

                                                          <value>Node Blocks: 0</value>

                                                       </property>

                                                       <property name="Cost Estimates">

                                                          <value>Estimated Node Cardinality: -1.0</value>

                                                       </property>

                                                       <property name="Query">

                                                          <value>SELECT g_0.dim_key, g_1.dim_name, g_0.measure FROM vdb.table AS g_0 INNER JOIN vdb.dim_table AS g_1 ON g_0.dim_key = g_1.dim_key WHERE (g_0.date_key &gt;= '2015-09-01') AND (g_0.date_key &lt;= '2015-09-14') AND (g_0.customer_key = 12345)</value>

                                                       </property>

                                                       <property name="Model Name">

                                                          <value>vdb</value>

                                                       </property>

                                                    </node>

                                                 </property>

                                                 <property name="Window Functions">

                                                    <value>(PARTITION BY vdb__1.dim_key)</value>

                                                    <value>(PARTITION BY 1)</value>

                                                 </property>

                                              </node>

                                           </property>

                                           <property name="Select Columns">

                                              <value>vdb__1.dim_key</value>

                                              <value>dim_table__1.dim_name</value>

                                              <value>SUM(vdb__1.measure) OVER (PARTITION BY vdb__1.dim_key) AS last_period_measure</value>

                                              <value>((SUM(vdb__1.measure) OVER (PARTITION BY vdb__1.dim_key) / SUM(vdb__1.measure) OVER (PARTITION BY 1)) * 100) AS last_period_pct_overall</value>

                                           </property>

                                        </node>

                                     </property>

                                     <property name="Join Strategy">

                                        <value>ENHANCED SORT JOIN RAN AS SORT MERGE (SORT/SORT_DISTINCT)</value>

                                     </property>

                                     <property name="Join Type">

                                        <value>LEFT OUTER JOIN</value>

                                     </property>

                                     <property name="Join Criteria">

                                        <value>this_period.dim_key=last_period.dim_key</value>

                                     </property>

                                  </node>

                               </property>

                               <property name="Sort Columns">

                                  <value>[this_period.this_period_measure DESC]</value>

                               </property>

                               <property name="Sort Mode">

                                  <value>SORT</value>

                               </property>

                            </node>

                         </property>

                         <property name="Row Offset">

                            <value>null</value>

                         </property>

                         <property name="Row Limit">

                            <value>10</value>

                         </property>

                      </node>

                   </property>

                   <property name="Select Columns">

                      <value>this_period.dim_key</value>

                      <value>this_period.dim_name</value>

                      <value>this_period.this_period_measure</value>

                      <value>this_period.this_period_pct_overall</value>

                      <value>last_period.last_period_measure</value>

                      <value>last_period.last_period_pct_overall</value>

                   </property>

                   <property name="Data Bytes Sent">

                      <value>0</value>

                   </property>

                   <property name="Planning Time">

                      <value>16</value>

                   </property>

                </node>

                • 5. Re: Assertion Failed in 8.12, but not 8.11.4
                  Scott Wallace Newbie

                  Hi Steven - see stack and plan above. I realized I previously did not mention the use of analytical functions. That may be the reason you were unable to replicate? Not sure. Anyway, let me know if I should still open an issue for this.

                   

                  Thanks,

                  Scott

                  • 6. Re: Assertion Failed in 8.12, but not 8.11.4
                    Steven Hawkins Master

                    > Anyway, let me know if I should still open an issue for this.

                     

                    Yes, I can now reproduce this.  Please open an issue and the fix will get into 8.12.1.

                    • 8. Re: Assertion Failed in 8.12, but not 8.11.4
                      Scott Wallace Newbie

                      I was just about to open the issue, but saw you already opened one. Thanks for addressing!