[
https://issues.apache.org/jira/browse/CALCITE-6327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17828550#comment-17828550
]
James Duong commented on CALCITE-6327:
--------------------------------------
To reproduce it (and build a test case), the easiest way is probably to have a
validator which overrides deriveType() and calls getValidatedNodeTypeIfKnown()
when the node is a CaseCall. Then, with a query containing COALESCE, which will
be rewritten as a CASE in unconditional rewrites, this should throw.
> getValidatedNodeTypeIfKnown should never throw
> ----------------------------------------------
>
> Key: CALCITE-6327
> URL: https://issues.apache.org/jira/browse/CALCITE-6327
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.36.0
> Reporter: Claude Brisson
> Priority: Major
>
> During validation, when a SqlNode has been rewritten (for instance when a
> COALESCE call has been rewritten as a CASE call) but does not yet have a
> RelDataType, the method SqlValidatorImpl.getValidatedNodeTypeIfKnown() throws
> an exception because it relies on
> SqlValidatorImpl.getValidatedNodeType(originalExpr), not on
> SqlValidatorImpl.getValidatedNodeTypeIfKnown(originalExpr).
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)