[ https://issues.apache.org/jira/browse/CALCITE-2673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16687375#comment-16687375 ]
Julian Hyde commented on CALCITE-2673: -------------------------------------- It makes sense that {{SqlDialect.supportsFunction}} is for built-in functions only. User-defined functions and procedures like in schemas, so should be read by {{JdbcSchema}}. And {{JdbcSchema}} has access to a connection in order to read them, whereas {{SqlDialect}} does not. Comments: * Some of the functions are not standard or not scalar functions, so should not be on the list: SECOND, YEAR, VALUES, MINUS, ANY_VALUE. * It's misleading to have a set called DEFAULT_OPERATORS_LIST * Please clarify in the javadoc for {{SqlDialect.supportsFunction}} that it only applies to built-in scalar functions and operators, and that UDFs come from JdbcSchema. Jethro's case was because different versions of Jethro might have different sets of built-in functions. Therefore it is appropriate to have multiple instances of {{JethroDataSqlDialect}}, each with a different set of function. However, the implementation had some hacks that I don't want to repeat. > 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)