yashmayya commented on code in PR #14264: URL: https://github.com/apache/pinot/pull/14264#discussion_r1816148251
########## pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/NullHandlingIntegrationTest.java: ########## @@ -326,6 +326,31 @@ public void testAggregateServerReturnFinalResult(boolean useMultiStageQueryEngin assertTrue(response.get("resultTable").get("rows").get(0).get(0).isNull()); } + @Test + public void testWindowFunctionIgnoreNulls() + throws Exception { + // Window functions are only supported in the multi-stage query engine + setUseMultiStageQueryEngine(true); + String sqlQuery = + "SELECT salary, LAST_VALUE(salary) IGNORE NULLS OVER (ORDER BY DaysSinceEpoch) AS gapfilledSalary from " Review Comment: Yes, it works with bounded preceding / following as well. > I remember running into some exception when trying it out Was it something like this error during query planning: ``` Caused by: java.lang.RuntimeException: Failed to convert query to relational expression: ... Caused by: java.lang.AssertionError: Conversion to relational algebra failed to preserve datatypes: ``` Interestingly, it looks like Calcite throws this error if the window function's input column is not nullable in the table schema (i.e., if `enableColumnBasedNullHandling` is `false` or the column has `"notNull": true`) and `IGNORE NULLS` or `RESPECT NULLS` option is used. While the error message is not the most clear, I don't think this is an actual bug because it doesn't really make sense to use those null handling related options if the window function's input column is not nullable. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org