[
https://issues.apache.org/jira/browse/CALCITE-7035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17953510#comment-17953510
]
Alessandro Solimando commented on CALCITE-7035:
-----------------------------------------------
CALCITE-7012 talks about implementing the (previously done by the validator)
rewrite for calls with subqueries as argument via a rule, but I didn't find an
indication that some queries now can't be executed with enumerable anymore, I
couldn't ascertain, from that ticket, if that's intended or not, and therefore
if this is a regression or an accepted behavior.
My question is, shall we consider this acceptable since it's _Enumerable_ and
planning is not affected, or shall we have a temporary workaround waiting for
CALCITE-7012 [~mbudiu]?
> SQL calls without an implementor or convertlet (NULLIF, YEAR, ...) throw an
> error when having a subquery as parameter
> ---------------------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-7035
> URL: https://issues.apache.org/jira/browse/CALCITE-7035
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.40.0
> Reporter: Aleksey Plekhanov
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.40.0
>
>
> After CALCITE-6978 {{SqlCall}}'s with subqueries are not rewritten during
> validation even when {{withCallRewrite(true)}} property is set in the
> configuration.
> Functions like {{NULLIF}}, {{YEAR}}, {{MONTH}}, etc don't have implementor or
> convertlet, so, when used with subqueries, throw an error: Unable to
> implement.
> Examples of problematic queries:
> {noformat}
> select nullif((select max(emps.age) from emps), 0);
> select year(select max(joinedat) from emps);
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)