Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15605

Calcite. Unexpected result with aggregate inside subquery.

    XMLWordPrintableJSON

Details

    Description

      statement ok
      CREATE TABLE integers(i INTEGER)
      
      statement ok
      INSERT INTO integers VALUES (1), (2), (3), (NULL)
      
      query R SELECT i, SUM(i), (SELECT SUM(i)+SUM(i1.i) FROM integers) FROM integers i1 GROUP BY i ORDER BY i;
      ----
      1  1.000000 10
      2  2.000000 14
      3  3.000000 18
      NULL NULL NULL 
      /subquery/scalar/test_correlated_aggregate_subquery.test_ignore
      
      /subquery/scalar/test_varchar_correlated_subquery.test_ignore
      

       

      Caused by: java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
          at SC.execute(Unknown Source)
          at org.apache.ignite.internal.sql.engine.exec.exp.ExpressionFactoryImpl$ProjectImpl.apply(ExpressionFactoryImpl.java:654)
          at org.apache.ignite.internal.sql.engine.exec.rel.StorageScanNode.push(StorageScanNode.java:197)
          at org.apache.ignite.internal.sql.engine.exec.rel.StorageScanNode$SubscriberImpl.lambda$onComplete$2(StorageScanNode.java:303)
          at org.apache.ignite.internal.sql.engine.exec.ExecutionContext.lambda$execute$0(ExecutionContext.java:315)

      Attachments

        Issue Links

          Activity

            People

              korlov Konstantin Orlov
              zstan Evgeny Stanilovsky
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: