[CALCITE-2317] Support JDBC DatabaseMetaData.getFunctions#2118
[CALCITE-2317] Support JDBC DatabaseMetaData.getFunctions#2118MalteBellmann wants to merge 1 commit into
Conversation
|
|
||
| Enumerable<MetaFunction> functions(final MetaSchema schema, final String catalog, | ||
| final Predicate1<String> functionNameMatcher) { | ||
| return functions(schema, catalog) |
There was a problem hiding this comment.
Is it possible to add some tests?
There was a problem hiding this comment.
Thanks for reviewing, i've added a test and sorting according to the JDBC specification.
FYI, there is also a discussion in JIRA on how to handle built-in functions.
6d0a92a to
2ec7d9c
Compare
6724572 to
27132c8
Compare
|
@chunweilei do you have time to review this updated PR? I think it is ready to merge |
| Enumerable<MetaFunction> functions(final MetaSchema schema_, final String catalog) { | ||
| final CalciteMetaSchema schema = (CalciteMetaSchema) schema_; | ||
| Enumerable<MetaFunction> opTableFunctions = Linq4j.emptyEnumerable(); | ||
| if (schema.getName().equals("metadata")) { |
There was a problem hiding this comment.
Out of curiosity: why hardcode metadata as schema name?
There was a problem hiding this comment.
The idea was: It is hardcoded in https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/jdbc/CalciteSchema.java#L525-L527 and I didn't see a better way.
But I just realized, I can use MetadataSchema.INSTANCE for the check. I will update the PR accordingly
|
Overall makes sense to me |
DatabaseMetaData.getFunctions() on a connection to Calcite now returns UDFs in the respective schema and system functions in the "metadata" schema.
27132c8 to
33137e8
Compare
| + " ]\n" | ||
| + "}"; | ||
| CalciteAssert.model(model) | ||
| .withDefaultSchema("adhoc") |
|
Merged via e447ff8 |
DatabaseMetaData.getFunctions() on a connection to Calcite now returns UDFs.