I think you’ll need to change the parser to generate a call to the SQL standard 
TRANSLATE if it sees ‘USING’ and generate a call to an unresolved TRANSLATE 
function if it sees ‘,’.

I’d appreciate if you could add the Oracle-style TRANSLATE function to 
SqlStdOperatorTable (call it say TRANSLATE3, since it has 3 parameters). Then 
the validator will be able to resolve it.

Julian

> On Feb 25, 2016, at 7:20 AM, Arina Yelchiyeva <[email protected]> 
> wrote:
> 
> Hi all!
> 
> In Drill we faced the issue that Calcite doesn't allow Hive function
> translate (expession, from_string, to_string) as Calcite expects different
> syntax: translate( expression USING identifier).
> Though translate(expression USING identifier) is an SQL standard, translate
> (expession, from_string, to_string) is widely used among other databases.
> 
> Is there a way customly complement Calcite parse instructions for translate
> function without Calcite code change?
> I see that we can add custom sql statements, literals and so on but I
> didn't figure out how all these can be used for translate function case.
> 
> Kind regards
> Arina

Reply via email to