There are two main steps you'd have to take here. Firstly, you'd have
to change the operand types accepted by CONCAT in SqlStdOperatorTable.
Second, you'd have to redefine the CONCAT method in RexImpTable to
something that actually builds the string instead of just using
String.concat.

Unfortunately, I don't think you can override the behaviour of
built-in operators without making your build of Calcite.
--
Michael Mior
[email protected]

Le mer. 6 févr. 2019 à 17:07, Paul Trepagnier <[email protected]> a écrit :
>
> I am using Calcite to try to be a federated database server for a BI tool.
> This BI tool is sending queries that I cannot change at the source.  So, I
> am trying to do some customizations within Calcite to handle these
> queries.
>
> For instance, one of the queries tries to do a sql concatenate between a
> string and an integer.  Calcite throws an exception for
> this: org.apache.calcite.sql.validate.SqlValidatorException: Cannot apply
> '||' to arguments of type '<VARCHAR> || <INTEGER>'. Supported form(s):
> '<STRING> || <STRING>'
>
> Is there an easy way to override the behavior of the concatenate operator?
> I am new to Calcite, so I do not know what my options are for customizing
> the planning/validation behavior.  If someone is able to point me in the
> right direction, I would greatly appreciate it.
>
> Thank you for any help you can provide,
>
> Paul

Reply via email to