[jira] [Commented] (CALCITE-6327) getValidatedNodeTypeIfKnown should never throw

2024-04-09 Thread Mihai Budiu (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17835548#comment-17835548
 ] 

Mihai Budiu commented on CALCITE-6327:
--

You don't need to assign it, but if you are confident the issue is solved I 
will mark it as "Resolved".

> 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
>Assignee: Mihai Budiu
>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)


[jira] [Commented] (CALCITE-6327) getValidatedNodeTypeIfKnown should never throw

2024-04-09 Thread James Duong (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17835545#comment-17835545
 ] 

James Duong commented on CALCITE-6327:
--

Re-assigning to [~mbudiu] since this looks to have been fixed in CALCITE-6015.

> 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
>Assignee: Mihai Budiu
>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)


[jira] [Commented] (CALCITE-6327) getValidatedNodeTypeIfKnown should never throw

2024-04-09 Thread James Duong (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17835544#comment-17835544
 ] 

James Duong commented on CALCITE-6327:
--

This appears to have been fixed as part of CALCITE-6015.

Here's the PR:

[https://github.com/apache/calcite/commit/4823cb7760913f236e7f0f2cb149325b55a3f124#diff-c7f668762c07f4042575454e68c0774ea777477881601cafd78ddd038377c567]

 

[~cbrisson] , do you still see this as an issue?

> 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
>Assignee: James Duong
>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)


[jira] [Commented] (CALCITE-6327) getValidatedNodeTypeIfKnown should never throw

2024-03-19 Thread James Duong (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)


[jira] [Commented] (CALCITE-6327) getValidatedNodeTypeIfKnown should never throw

2024-03-16 Thread Julian Hyde (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17827760#comment-17827760
 ] 

Julian Hyde commented on CALCITE-6327:
--

A test case would be useful.

> 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)


[jira] [Commented] (CALCITE-6327) getValidatedNodeTypeIfKnown should never throw

2024-03-16 Thread Julian Hyde (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17827759#comment-17827759
 ] 

Julian Hyde commented on CALCITE-6327:
--

That sounds right. However, mutations of the AST make me nervous. I know we 
mutate the AST for a few reasons (e.g. expanding '*') but if you are doing an 
unsanctioned mutation then the blame is on you, not Calcite.

(Since Calcite was originally written, I have become more of a pure functional 
programmer and I wish we should remove all mutations.)

> 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)