calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Haidai <anton.hai...@gmail.com>
Subject Re: Is it possible to define an empty LogicalValues node using SQL?
Date Fri, 17 May 2019 15:56:27 GMT
As it turned out, a combination on "where 1=2" and
"FilterReduceExpressionsRule" works fine for my purposes, a code
sample could be found in the ticket description:
https://issues.apache.org/jira/browse/CALCITE-3076

On Fri, May 17, 2019 at 6:05 PM Anton Haidai <anton.haidai@gmail.com> wrote:
>
> Hello,
> I'm trying to reproduce a tricky bug in RelOptRulesTest. It requires
> an empty LogicalValues with a desired row type to be a direct input of
> a join. I can achieve the desired structure using RelBuilder and
> LogicalValues.createEmpty(), however, I can't reproduce it in test's
> SQL. For example, SQL "select 42 sal, 'Bobby' ename LIMIT 0" produces
> the following logical plan:
>
> LogicalSort(fetch=[0])
>   LogicalValues(tuples=[[]])
>
> But I need only the LogicalValues node, without LogicalSort or any
> other nodes on top of it.
> I have a workaround that replaces the nodes by means of a dedicated
> rule in preProgram, but this solution looks really poor.
>
> Possibly, there is some trick to define just an empty LogicalValues
> with a desired row type using SQL only?
>
> --
> Best regards,
> Anton.



-- 
Best regards,
Anton.

Mime
View raw message