[jira] [Commented] (IGNITE-28499) Fix alias usage with GROUP BY for Calcite
[
https://issues.apache.org/jira/browse/IGNITE-28499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18092519#comment-18092519
]
Kirill Tkalenko commented on IGNITE-28499:
--
[~zstan] Thanks a lot; I checked the linked ticket and found the test there.
It would be great to include a link to the test next time.
Once the linked ticket is merged, I’ll close this one.
> Fix alias usage with GROUP BY for Calcite
> -
>
> Key: IGNITE-28499
> URL: https://issues.apache.org/jira/browse/IGNITE-28499
> Project: Ignite
> Issue Type: Bug
>Affects Versions: 2.18
>Reporter: Kirill Tkalenko
>Priority: Major
> Labels: ignite-2, ise
>
> Now, when I try to run the "select max(age) as age from PUBLIC.PERSON group
> by age" query, I get the error below. However, other DBMSs will run the query
> without errors.
> However, if I rewrite the query to:
> * select max(age) as max_age from PUBLIC.PERSON group by age
> * select max(age) from PUBLIC.PERSON group by age
> They will execute without errors.
> {noformat}
> class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed
> to validate query. From line 1, column 25 to line 1, column 32: Aggregate
> expression is illegal in GROUP BY clause
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:125)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:588)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:64)
> at
> java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:64)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:585)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:781)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:582)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:449)
> at
> org.apache.ignite.internal.processors.query.calcite.QueryChecker.check(QueryChecker.java:432)
> at org.company.ignite.calcite.OtherTest.name(OtherTest.java:25)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at
> org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2486)
> at java.base/java.lang.Thread.run(Thread.java:829)
> Caused by: org.apache.calcite.tools.ValidationException: From line 1, column
> 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY clause
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.validate(IgnitePlanner.java:205)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareExplain(PrepareServiceImpl.java:157)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:116)
> ... 20 more
> Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1,
> column 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY
> clause
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
> at
> org.apache.calcite.runtime.Res
[jira] [Commented] (IGNITE-28499) Fix alias usage with GROUP BY for Calcite
[ https://issues.apache.org/jira/browse/IGNITE-28499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18092338#comment-18092338 ] Evgeny Stanilovsky commented on IGNITE-28499: - [[email protected]]I already appent this test into calcite related issue but if you want - it always good to extend tests coverage. > Fix alias usage with GROUP BY for Calcite > - > > Key: IGNITE-28499 > URL: https://issues.apache.org/jira/browse/IGNITE-28499 > Project: Ignite > Issue Type: Bug >Affects Versions: 2.18 >Reporter: Kirill Tkalenko >Priority: Major > Labels: ignite-2, ise > > Now, when I try to run the "select max(age) as age from PUBLIC.PERSON group > by age" query, I get the error below. However, other DBMSs will run the query > without errors. > However, if I rewrite the query to: > * select max(age) as max_age from PUBLIC.PERSON group by age > * select max(age) from PUBLIC.PERSON group by age > They will execute without errors. > {noformat} > class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed > to validate query. From line 1, column 25 to line 1, column 32: Aggregate > expression is illegal in GROUP BY clause > at > org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:125) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:588) > at > org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:64) > at > java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) > at > org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:64) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:585) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:781) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:582) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:449) > at > org.apache.ignite.internal.processors.query.calcite.QueryChecker.check(QueryChecker.java:432) > at org.company.ignite.calcite.OtherTest.name(OtherTest.java:25) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:566) > at > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) > at > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > at > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) > at > org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) > at > org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2486) > at java.base/java.lang.Thread.run(Thread.java:829) > Caused by: org.apache.calcite.tools.ValidationException: From line 1, column > 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY clause > at > org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.validate(IgnitePlanner.java:205) > at > org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareExplain(PrepareServiceImpl.java:157) > at > org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:116) > ... 20 more > Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, > column 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY > clause > at > java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at > java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) > at > java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) > at > java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) > at > org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:511)
[jira] [Commented] (IGNITE-28499) Fix alias usage with GROUP BY for Calcite
[
https://issues.apache.org/jira/browse/IGNITE-28499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18092217#comment-18092217
]
Kirill Tkalenko commented on IGNITE-28499:
--
[~zstan] Okay, we have to add a test in this ticket. I can add it myself after
implementing the linked one.
> Fix alias usage with GROUP BY for Calcite
> -
>
> Key: IGNITE-28499
> URL: https://issues.apache.org/jira/browse/IGNITE-28499
> Project: Ignite
> Issue Type: Bug
>Affects Versions: 2.18
>Reporter: Kirill Tkalenko
>Priority: Major
> Labels: ignite-2, ise
>
> Now, when I try to run the "select max(age) as age from PUBLIC.PERSON group
> by age" query, I get the error below. However, other DBMSs will run the query
> without errors.
> However, if I rewrite the query to:
> * select max(age) as max_age from PUBLIC.PERSON group by age
> * select max(age) from PUBLIC.PERSON group by age
> They will execute without errors.
> {noformat}
> class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed
> to validate query. From line 1, column 25 to line 1, column 32: Aggregate
> expression is illegal in GROUP BY clause
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:125)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:588)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:64)
> at
> java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:64)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:585)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:781)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:582)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:449)
> at
> org.apache.ignite.internal.processors.query.calcite.QueryChecker.check(QueryChecker.java:432)
> at org.company.ignite.calcite.OtherTest.name(OtherTest.java:25)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at
> org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2486)
> at java.base/java.lang.Thread.run(Thread.java:829)
> Caused by: org.apache.calcite.tools.ValidationException: From line 1, column
> 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY clause
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.validate(IgnitePlanner.java:205)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareExplain(PrepareServiceImpl.java:157)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:116)
> ... 20 more
> Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1,
> column 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY
> clause
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
> at
> org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:511)
> at org.apache.calcite.sql.Sql
[jira] [Commented] (IGNITE-28499) Fix alias usage with GROUP BY for Calcite
[ https://issues.apache.org/jira/browse/IGNITE-28499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18091886#comment-18091886 ] Evgeny Stanilovsky commented on IGNITE-28499: - [[email protected]] check with new calcite ver - all passed correctly, plz wait linked issue to be done. > Fix alias usage with GROUP BY for Calcite > - > > Key: IGNITE-28499 > URL: https://issues.apache.org/jira/browse/IGNITE-28499 > Project: Ignite > Issue Type: Bug >Affects Versions: 2.18 >Reporter: Kirill Tkalenko >Priority: Major > Labels: ignite-2, ise > > Now, when I try to run the "select max(age) as age from PUBLIC.PERSON group > by age" query, I get the error below. However, other DBMSs will run the query > without errors. > However, if I rewrite the query to: > * select max(age) as max_age from PUBLIC.PERSON group by age > * select max(age) from PUBLIC.PERSON group by age > They will execute without errors. > {noformat} > class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed > to validate query. From line 1, column 25 to line 1, column 32: Aggregate > expression is illegal in GROUP BY clause > at > org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:125) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:588) > at > org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:64) > at > java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) > at > org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:64) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:585) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:781) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:582) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:449) > at > org.apache.ignite.internal.processors.query.calcite.QueryChecker.check(QueryChecker.java:432) > at org.company.ignite.calcite.OtherTest.name(OtherTest.java:25) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:566) > at > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) > at > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > at > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) > at > org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) > at > org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2486) > at java.base/java.lang.Thread.run(Thread.java:829) > Caused by: org.apache.calcite.tools.ValidationException: From line 1, column > 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY clause > at > org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.validate(IgnitePlanner.java:205) > at > org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareExplain(PrepareServiceImpl.java:157) > at > org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:116) > ... 20 more > Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, > column 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY > clause > at > java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at > java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) > at > java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) > at > java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) > at > org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:511) > at org.apache.calcit
[jira] [Commented] (IGNITE-28499) Fix alias usage with GROUP BY for Calcite
[
https://issues.apache.org/jira/browse/IGNITE-28499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18072325#comment-18072325
]
Kirill Tkalenko commented on IGNITE-28499:
--
[~zstan] Is an update coming?
> Fix alias usage with GROUP BY for Calcite
> -
>
> Key: IGNITE-28499
> URL: https://issues.apache.org/jira/browse/IGNITE-28499
> Project: Ignite
> Issue Type: Bug
>Affects Versions: 2.18
>Reporter: Kirill Tkalenko
>Priority: Major
> Labels: ignite-2
>
> Now, when I try to run the "select max(age) as age from PUBLIC.PERSON group
> by age" query, I get the error below. However, other DBMSs will run the query
> without errors.
> However, if I rewrite the query to:
> * select max(age) as max_age from PUBLIC.PERSON group by age
> * select max(age) from PUBLIC.PERSON group by age
> They will execute without errors.
> {noformat}
> class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed
> to validate query. From line 1, column 25 to line 1, column 32: Aggregate
> expression is illegal in GROUP BY clause
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:125)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:588)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:64)
> at
> java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:64)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:585)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:781)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:582)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:449)
> at
> org.apache.ignite.internal.processors.query.calcite.QueryChecker.check(QueryChecker.java:432)
> at org.company.ignite.calcite.OtherTest.name(OtherTest.java:25)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at
> org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2486)
> at java.base/java.lang.Thread.run(Thread.java:829)
> Caused by: org.apache.calcite.tools.ValidationException: From line 1, column
> 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY clause
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.validate(IgnitePlanner.java:205)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareExplain(PrepareServiceImpl.java:157)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:116)
> ... 20 more
> Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1,
> column 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY
> clause
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
> at
> org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:511)
> at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:960)
> at org.apache.calcite.sql.SqlUtil
[jira] [Commented] (IGNITE-28499) Fix alias usage with GROUP BY for Calcite
[
https://issues.apache.org/jira/browse/IGNITE-28499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18072305#comment-18072305
]
Evgeny Stanilovsky commented on IGNITE-28499:
-
seems it been fixed here
[1] https://issues.apache.org/jira/browse/CALCITE-7052
> Fix alias usage with GROUP BY for Calcite
> -
>
> Key: IGNITE-28499
> URL: https://issues.apache.org/jira/browse/IGNITE-28499
> Project: Ignite
> Issue Type: Bug
>Affects Versions: 2.18
>Reporter: Kirill Tkalenko
>Priority: Major
> Labels: ignite-2
>
> Now, when I try to run the "select max(age) as age from PUBLIC.PERSON group
> by age" query, I get the error below. However, other DBMSs will run the query
> without errors.
> However, if I rewrite the query to:
> * select max(age) as max_age from PUBLIC.PERSON group by age
> * select max(age) from PUBLIC.PERSON group by age
> They will execute without errors.
> {noformat}
> class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed
> to validate query. From line 1, column 25 to line 1, column 32: Aggregate
> expression is illegal in GROUP BY clause
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:125)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:588)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:64)
> at
> java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:64)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:585)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:781)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:582)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:449)
> at
> org.apache.ignite.internal.processors.query.calcite.QueryChecker.check(QueryChecker.java:432)
> at org.company.ignite.calcite.OtherTest.name(OtherTest.java:25)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at
> org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2486)
> at java.base/java.lang.Thread.run(Thread.java:829)
> Caused by: org.apache.calcite.tools.ValidationException: From line 1, column
> 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY clause
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.validate(IgnitePlanner.java:205)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareExplain(PrepareServiceImpl.java:157)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:116)
> ... 20 more
> Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1,
> column 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY
> clause
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
> at
> org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:511)
> at org.apache.calcite.sql.SqlUtil.newContextException(Sql
[jira] [Commented] (IGNITE-28499) Fix alias usage with GROUP BY for Calcite
[
https://issues.apache.org/jira/browse/IGNITE-28499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18072256#comment-18072256
]
Kirill Tkalenko commented on IGNITE-28499:
--
[~zstan] As described in the title and in the error log: Calcite.
Tried it on a fresh master, the problem persists.
> Fix alias usage with GROUP BY for Calcite
> -
>
> Key: IGNITE-28499
> URL: https://issues.apache.org/jira/browse/IGNITE-28499
> Project: Ignite
> Issue Type: Bug
>Affects Versions: 2.18
>Reporter: Kirill Tkalenko
>Priority: Major
> Labels: ignite-2
>
> Now, when I try to run the "select max(age) as age from PUBLIC.PERSON group
> by age" query, I get the error below. However, other DBMSs will run the query
> without errors.
> However, if I rewrite the query to:
> * select max(age) as max_age from PUBLIC.PERSON group by age
> * select max(age) from PUBLIC.PERSON group by age
> They will execute without errors.
> {noformat}
> class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed
> to validate query. From line 1, column 25 to line 1, column 32: Aggregate
> expression is illegal in GROUP BY clause
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:125)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:588)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:64)
> at
> java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:64)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:585)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:781)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:582)
> at
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:449)
> at
> org.apache.ignite.internal.processors.query.calcite.QueryChecker.check(QueryChecker.java:432)
> at org.company.ignite.calcite.OtherTest.name(OtherTest.java:25)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at
> org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2486)
> at java.base/java.lang.Thread.run(Thread.java:829)
> Caused by: org.apache.calcite.tools.ValidationException: From line 1, column
> 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY clause
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.validate(IgnitePlanner.java:205)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareExplain(PrepareServiceImpl.java:157)
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:116)
> ... 20 more
> Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1,
> column 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY
> clause
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
> at
> org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:511)
> at org.apache.calcite.sql.S
[jira] [Commented] (IGNITE-28499) Fix alias usage with GROUP BY for Calcite
[ https://issues.apache.org/jira/browse/IGNITE-28499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18072254#comment-18072254 ] Evgeny Stanilovsky commented on IGNITE-28499: - [[email protected]] what sql engine do you use ? > Fix alias usage with GROUP BY for Calcite > - > > Key: IGNITE-28499 > URL: https://issues.apache.org/jira/browse/IGNITE-28499 > Project: Ignite > Issue Type: Bug >Affects Versions: 2.18 >Reporter: Kirill Tkalenko >Priority: Major > Labels: ignite-2 > > Now, when I try to run the "select max(age) as age from PUBLIC.PERSON group > by age" query, I get the error below. However, other DBMSs will run the query > without errors. > However, if I rewrite the query to: > * select max(age) as max_age from PUBLIC.PERSON group by age > * select max(age) from PUBLIC.PERSON group by age > They will execute without errors. > {noformat} > class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed > to validate query. From line 1, column 25 to line 1, column 32: Aggregate > expression is illegal in GROUP BY clause > at > org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:125) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:588) > at > org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:64) > at > java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) > at > org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:64) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:585) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:781) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:582) > at > org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:449) > at > org.apache.ignite.internal.processors.query.calcite.QueryChecker.check(QueryChecker.java:432) > at org.company.ignite.calcite.OtherTest.name(OtherTest.java:25) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:566) > at > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) > at > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > at > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) > at > org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) > at > org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2486) > at java.base/java.lang.Thread.run(Thread.java:829) > Caused by: org.apache.calcite.tools.ValidationException: From line 1, column > 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY clause > at > org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.validate(IgnitePlanner.java:205) > at > org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareExplain(PrepareServiceImpl.java:157) > at > org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:116) > ... 20 more > Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, > column 25 to line 1, column 32: Aggregate expression is illegal in GROUP BY > clause > at > java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at > java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) > at > java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) > at > java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) > at > org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:511) > at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:960) > at
