[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pull requests to review

Vladimir, could you elaborate more on this?

Should such mentioned rule convert the RexLiterals with TimestampString
value to Long with the time zone from data context?
Are you sure that such rule wouldbe triggered before the
logic  SqlUserDefinedTableMacro.coerce(SqlUserDefinedTableMacro.java:190)?
And finally - I thought that RelOptRule is an entry for optimization and
not narrowing to proper execution. What if planner would not choose to
apply such rule - we would have a case in which some expressions with
functions tables could be computed properly while other wont.

Maybe better to take this discussion to CALCITE-2641?

On Tue, Nov 6, 2018 at 1:46 PM Vladimir Sitnikov <
sitnikov.vladimir@xxxxxxxxx> wrote:

> >There is no explicit time zone here provided, only the implicit one based
> on
> There's connection-default time zone
> (see org.apache.calcite.DataContext.Variable#TIME_ZONE )
> I think the way to go there is:
> 1) Convert SqlNod to Rex via SqlToRelConverter
> 2) Evaluate the Rex with something like ReduceExpressionsRule with
> exception that non-constant parameters are replaced with nulls
> (ReduceExpressionsRule has a machinery to determine if expression is a
> constant or not)
> That would make the thing consistent with existing computations/casts
> (which are tricky to get right).
> Vladimir

Piotr Bojko