[
https://issues.apache.org/jira/browse/CALCITE-5479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17736296#comment-17736296
]
Gian Merlino commented on CALCITE-5479:
---------------------------------------
I believe so. The main changes are these two:
-
https://github.com/apache/calcite/pull/3030/files#diff-b0b8d58a792b8e60b9e97717912aecfc6695536f5026ac4d5231d14e34b91566L315-R315
-
https://github.com/apache/calcite/pull/3030/files#diff-2d686a3a894dffd63d982ee79961f6abe290f505d8cac4516fd3abf184cb565eL67-R67
Which have the effect of setting {{iFormalOperand}} properly in strictly more
cases.
The rest of the patch is about modifying {{FamilyOperandTypeChecker}} such that
it ignores {{iFormalOperand}} when run as a single-operand checker. That is
what allows us to remove the code that specifically sets it to zero for
{{FamilyOperandTypeChecker.class}}. It is also what fixes the original bug that
inspired me to raise this case: {{FamilyOperandTypeChecker}} would not work
properly when composed inside another checker.
> FamilyOperandTypeChecker is not readily composable in sequences
> ---------------------------------------------------------------
>
> Key: CALCITE-5479
> URL: https://issues.apache.org/jira/browse/CALCITE-5479
> Project: Calcite
> Issue Type: Bug
> Reporter: Gian Merlino
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.35.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Handling for {{OperandTypes.sequence}} changed in
> [33f4ab40bbee26e06209061c35a422f2f1e05371|https://github.com/apache/calcite/commit/33f4ab40bbee26e06209061c35a422f2f1e05371#diff-b0b8d58a792b8e60b9e97717912aecfc6695536f5026ac4d5231d14e34b91566L303-R316]
> such that {{iFormalOperand}} passed to subcheckers is no longer always zero,
> but is instead:
> - Zero if the subchecker is {{FamilyOperandTypeChecker}}.
> - Otherwise, the operand number in the overall sequence.
> It causes problems for the way we're using sequence checkers in Druid, since
> we don't always use {{FamilyOperandTypeChecker}}, but we _do_ assume the old
> behavior: that {{iFormalOperand}} is always zero, and therefore we can put
> any checker into the sequence without it being "aware" that it is in a
> sequence.
> I marked this as a bug in case this change was made accidentally. If it was
> made for a reason, please let me know. Thanks.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)