You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Mobile <go...@qq.com.INVALID> on 2024/07/03 08:08:24 UTC

[BUG]JDBC adapter does not work with PATH parameter in JSON/YAML models

Hello everyone!
&nbsp; &nbsp;&nbsp;I am created calcite's udf, like org.apache.calcite.test.UdfTest.testPath(), but when I use this function in jdbc schema, I get an error: No match found for function signature IS_CHANGE_TO. I checked the source code org.apache.calcite.model.ModelHandler.visit(JsonJdbcSchema), which does not handle the path parameter, Is this a BUG, ​​or how can I create udf in jdbc schema? The following is my model.json.


{
&nbsp; &nbsp; "version": "1.0",
&nbsp; &nbsp; "defaultSchema": "jdbc_schema",
&nbsp; &nbsp; "schemas":
&nbsp; &nbsp; [
&nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "name": "customer_functions",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "functions":
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "name": "IS_CHANGE_TO",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "className": "com.fs.calcite.functions.IsChangeToFunction"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]
&nbsp; &nbsp; &nbsp; &nbsp; },
&nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "name": "jdbc_schema",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "type": "jdbc",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "path":
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "customer_functions"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "cache": false,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "jdbcDriver": "com.mysql.cj.jdbc.Driver",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "jdbcUrl": "jdbc:mysql://xxxx",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "jdbcUser": "xxxx",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "jdbcPassword": "xxx"
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; ]
}



Thanks,
hector.gong