calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Haidai <>
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:

On Fri, May 17, 2019 at 6:05 PM Anton Haidai <> 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,

View raw message