AlexanderKM opened a new issue, #15204: URL: https://github.com/apache/pinot/issues/15204
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](https://github.com/apache/pinot/blob/master/pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java#L426) Example query: ```sql 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: https://github.com/apache/pinot/commit/25e3dc4737164921018896b0ac5a5952f4007192 This is likely a similar issue to https://github.com/apache/pinot/issues/11313 And others have pointed out this issue on slack: https://apache-pinot.slack.com/archives/C011C9JHN7R/p1707886703534859 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
