[
https://issues.apache.org/jira/browse/CALCITE-7338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18045968#comment-18045968
]
Yash Mayya commented on CALCITE-7338:
-------------------------------------
[~mbudiu] thanks for clarifying, that makes sense. I'm not too familiar with
the Calcite project internals, so while I'd be more than happy to contribute,
I'd also request some pointers in the right direction!
I see that
[SqlHintsConverterTest|https://github.com/apache/calcite/blob/b12a9cefb67eefdd3b24ca2ac5893afeb021b80f/core/src/test/java/org/apache/calcite/test/SqlHintsConverterTest.java#L255]
already has a test case for window functions but all that the test is doing
right now is verifying that the hint is attached to the {{LogicalProject}} node
created from the SQL using the {{SqlToRelConverter}} (the window is retained as
is in the project, as also noted in the Jira description). Is that the right
place to add a new test that also runs a {{HepPlanner}} with
{{ProjectToLogicalProjectAndWindowRule}} on the {{RelNode}} generated by
{{SqlToRelConverter}} so that we can make assertions on the generated
{{LogicalWindow}} node as well?
> Window hints are not propagated to window rel nodes
> ---------------------------------------------------
>
> Key: CALCITE-7338
> URL: https://issues.apache.org/jira/browse/CALCITE-7338
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Yash Mayya
> Priority: Major
>
> Window hints don't currently seem to be propagated to the window rel nodes.
> We're using hints in Apache Pinot's multi-stage query engine (which is built
> on top of Calcite), and while hints on joins, aggregates, table scans etc.
> work as expected, we've found that hints on windows are not propagating at
> all. IIUC, most other logical nodes are created in the SqlToRelConverter
> phase and hints are propagated to the appropriate rel node based on the hint
> strategy table
> [here|https://github.com/apache/calcite/blob/34989b0ed7793cedf713c2f159de6247a730458c/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java#L823-L842].
> However, logical window nodes are created after the SqlToRelConverter phase,
> by the
> [ProjectToWindowRule|https://github.com/apache/calcite/blob/f19e854c39e5a43aea2323e455229bd8dfc6dcdb/core/src/main/java/org/apache/calcite/rel/rules/ProjectToWindowRule.java#L75]
> planner rule - and it doesn’t look like there’s any logic there to preserve
> or propagate hints.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)