You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use the RequestUtils#getTableNames a bit on our end to track and report which tables our queries are hitting, and this method seems to be failing for queries that contain window functions. Under the hood, the CalciteSqlParser is failing in the method compileSqlNodeToPinotQuery
Example query:
SET useMultiStageEngine=true;
SELECT foo, occurredAt, LAG(occurredAt) OVER (PARTITION BY foo ORDER BY occurredAt) lag
Which gives this exception:
java.lang.ClassCastException: class org.apache.calcite.sql.SqlWindow cannot be cast to class org.apache.calcite.sql.SqlBasicCall (org.apache.calcite.sql.SqlWindow and org.apache.calcite.sql.SqlBasicCall are in unnamed module of loader 'app')
at org.apache.pinot.sql.parsers.CalciteSqlParser.toExpression(CalciteSqlParser.java:740)
at org.apache.pinot.sql.parsers.CalciteSqlParser.compileFunctionExpression(CalciteSqlParser.java:802)
at org.apache.pinot.sql.parsers.CalciteSqlParser.toExpression(CalciteSqlParser.java:740)
at org.apache.pinot.sql.parsers.CalciteSqlParser.toExpression(CalciteSqlParser.java:690)
at org.apache.pinot.sql.parsers.CalciteSqlParser.convertSelectList(CalciteSqlParser.java:608)
at org.apache.pinot.sql.parsers.CalciteSqlParser.compileWithoutRewrite(CalciteSqlParser.java:461)
at org.apache.pinot.sql.parsers.CalciteSqlParser.compileSqlNodeToPinotQuery(CalciteSqlParser.java:427)
at org.apache.pinot.common.utils.request.RequestUtilsTest.testResolveTableNames(RequestUtilsTest.java:82)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:141)
at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:687)
at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:230)
at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:63)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:995)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:203)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:154)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:134)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at org.testng.TestRunner.privateRun(TestRunner.java:741)
at org.testng.TestRunner.run(TestRunner.java:616)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:421)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:413)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:373)
at org.testng.SuiteRunner.run(SuiteRunner.java:312)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1274)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1208)
at org.testng.TestNG.runSuites(TestNG.java:1112)
at org.testng.TestNG.run(TestNG.java:1079)
at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:65)
at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)
I have added a test here to show the example: 25e3dc4
We use the
RequestUtils#getTableNames
a bit on our end to track and report which tables our queries are hitting, and this method seems to be failing for queries that contain window functions. Under the hood, the CalciteSqlParser is failing in the method compileSqlNodeToPinotQueryExample query:
Which gives this exception:
I have added a test here to show the example: 25e3dc4
This is likely a similar issue to #11313
And others have pointed out this issue on slack: https://apache-pinot.slack.com/archives/C011C9JHN7R/p1707886703534859
The text was updated successfully, but these errors were encountered: