You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Francesco Guardiani (Jira)" <ji...@apache.org> on 2021/09/14 07:59:00 UTC

[jira] [Created] (CALCITE-4775) Fine grained tuning of call rewrite behaviour

Francesco Guardiani created CALCITE-4775:
--------------------------------------------

             Summary: Fine grained tuning of call rewrite behaviour 
                 Key: CALCITE-4775
                 URL: https://issues.apache.org/jira/browse/CALCITE-4775
             Project: Calcite
          Issue Type: New Feature
    Affects Versions: 1.26.0
         Environment: Calcite 1.26
            Reporter: Francesco Guardiani


In a Flink SQL PR [https://github.com/apache/flink/pull/17256] I've tried to disable the call rewrite feature of Calcite parser to disable the rewrite of COALESCE. The problem with this is that it creates a regression in other components, since we rely on call rewrite for other sql features.

Would it be possible to modify the sql call rewrite feature to pick (or alternatively disable) which sql operator should be rewritten?

For example, the SqlValidator.Config could take as parameter a list of excludeCallRewrite
SqlOperator classes, which can be checked later by the SqlValidatorImpl to enable or disable a rewrite of a specific class:

{code:java}
SqlValidator.Config.DEFAULT
     .withCallRewrite(true)
     .withExcludedCallRewrite(SqlCoalesceFunction.class)
{code}

And then in SqlValidatorImpl:

{code:java}
if (config.callRewrite() && !config.isCallRewriteExcluded(call.getOperator().getClass())) {
    node = call.getOperator().rewriteCall(this, call);
}
{code}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)