Dustin ~

The type inference for all kinds of operator/functions are defined by 2 kinds 
of components in Calcite:


• The SqlOperandTypeChecker infers the operands data types
• The SqlReturnTypeInference infers the return data type of the call

That means the type inference strategy is fixed and AFAIK, there is no way to 
change it dynamically, the strategy is registered statically with the 
function/operator.

If you want to explicit specify the all the integer literals should be 
INT64(BIGINT) type, you can use a RexShuttle to visit all the rexCalls and 
rewrite your relational expression.

Best,
Danny Chan
在 2019年10月25日 +0800 AM10:46,Dustin Freeman <jungle.free...@gmail.com>,写道:
> Hi All,
>
> After I translate a query (SQL text) into a RelNode Tree like this,
>
> RelNode res = planner.getLogicalPlan(getSqlText());
>
> What's the simplest way to do/change type inference and set nullability for
> all expressions in node res?
>
> It seems that RelNode has some type info already like below. It seems both
> constants should have a data type int64, rather than int32. A conversion
> there is needed. That conversion could be simplified to (const int64)1).
> Anyways to let Calcite to do such changes?
>
> bool greater_than(int64 minus((int64) PID, *(const int32) 1)*, (const
> int32) 100)
>
>
> Thanks,
>
> Dustin

Reply via email to