Evgeny Stanilovsky created IGNITE-28879:
-------------------------------------------

             Summary: Calcite. Window function is failed after calcite ver 
changed to 1.42
                 Key: IGNITE-28879
                 URL: https://issues.apache.org/jira/browse/IGNITE-28879
             Project: Ignite
          Issue Type: Improvement
          Components: sql
            Reporter: Evgeny Stanilovsky
            Assignee: Evgeny Stanilovsky


Query (check [1]) :

{code:java}
SELECT * FROM (
    SELECT
        COUNT(*) OVER (PARTITION BY val2 ORDER BY val3) + SUM(val4) OVER 
(PARTITION BY val1 ORDER BY val3) AS total,
        COUNT(*) OVER (PARTITION BY val2 ORDER BY val3) AS val2count, SUM(val4) 
OVER (PARTITION BY val1 ORDER BY val3) AS val1sum
    FROM numbers
) sub WHERE total = val2count + val1sum;
{code}

Fails with :

{noformat}
Caused by: java.util.NoSuchElementException: 
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
        at java.base/java.util.AbstractList$Itr.next(AbstractList.java:377)
        at 
org.apache.ignite.internal.processors.query.calcite.util.Commons.transform(Commons.java:228)
        at 
org.apache.ignite.internal.processors.query.calcite.exec.exp.window.WindowPartitionFactory.<init>(WindowPartitionFactory.java:64)
        at 
org.apache.ignite.internal.processors.query.calcite.exec.LogicalRelImplementor.visit(LogicalRelImplementor.java:965)
        at 
org.apache.ignite.internal.processors.query.calcite.exec.LogicalRelImplementor.visit(LogicalRelImplementor.java:139)
        at 
org.apache.ignite.internal.processors.query.calcite.rel.IgniteWindow.accept(IgniteWindow.java:122)
{noformat}


[1] test_window_functions.test_ignore



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to