sreemanamala commented on code in PR #16301:
URL: https://github.com/apache/druid/pull/16301#discussion_r1573106717
##########
sql/src/main/java/org/apache/druid/sql/calcite/rel/Windowing.java:
##########
@@ -243,8 +244,14 @@ public static Windowing fromCalciteStuff(
// We know windowProject is a mapping due to the isMapping() check in
DruidRules. Check for null anyway,
// as defensive programming.
final Mappings.TargetMapping mapping = Preconditions.checkNotNull(
- partialQuery.getWindowProject().getMapping(),
- "mapping for windowProject[%s]", partialQuery.getWindowProject()
+
partialQuery.getWindowProject().getProjects().stream().map(RexNode::toString).collect(Collectors.toSet()).size()
+ < partialQuery.getWindowProject().getProjects().size()
+ ? Project.getPartialMapping(
+
partialQuery.getWindowProject().getRowType().getFieldCount(),
+ partialQuery.getWindowProject().getProjects()
+ )
+ : partialQuery.getWindowProject().getMapping(),
+ "mapping for windowProject[%s]", partialQuery.getWindowProject()
Review Comment:
didn't had to change the mapping type. both `INVERSE_FUNCTION` &
`INVERSE_PARTIAL_FUNCTION` are internally using `PartialFunctionImpl`
made use of `source might have 0 targets` by providing the target count as
`1 + highest index in our window projection`
--
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]