[
https://issues.apache.org/jira/browse/CALCITE-2673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16687200#comment-16687200
]
Jesus Camacho Rodriguez commented on CALCITE-2673:
--------------------------------------------------
I believe having at least a core set of supported functions in the default
method implementation is a better approach that just blindly accepting pushdown
of every function/operator. If a user needs specific function support depending
on their connection, they can create their own dialect, override the
'supportsFunction' method, and bind the dialect to that connection.
I could not figure out a way to have something more general than that, since
accessing the supported built-in functions seems to different for every DB.
For instance, Jethro dialect loads the supported functions into a cache when it
establishes the first connection executing a 'show functions extended' command,
and it identifies the Jethro version too (different versions, different sets of
supported functions).
However, I was checking MySQL and it does not seem there is currently a way to
extract the supported built-in functions dynamically (you can get stored
functions and procedures). Hence in that case the only option seems to be going
to the specific version documentation and hardcode them? E.g.
https://dev.mysql.com/doc/refman/5.6/en/func-op-summary-ref.html
> Default implementation of SqlDialect should not support pushing all functions
> -----------------------------------------------------------------------------
>
> Key: CALCITE-2673
> URL: https://issues.apache.org/jira/browse/CALCITE-2673
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Jesus Camacho Rodriguez
> Assignee: Jesus Camacho Rodriguez
> Priority: Major
> Fix For: 1.18.0
>
>
> SqlDialect contains a 'supportsFunction' that can be used by rules to know
> whether a certain function is supported in the given dialect, e.g., to choose
> whether to push a Filter expression to JDBC, etc.
> The default implementation of 'supportsFunction' always returns true.
> I believe a better idea would be to support in the default implementation for
> the method the most common SQL functions. Then each dialect can override that
> behavior and expand/limit the supported functions, e.g., JethroDataDialect
> already does that.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)