[
https://issues.apache.org/jira/browse/CALCITE-6745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ZheHu resolved CALCITE-6745.
----------------------------
Fix Version/s: 1.39.0
Resolution: Fixed
Fixed in
[274cc2d|https://github.com/apache/calcite/commit/274cc2d83f00fa3aa991dd801c1bca78f5c60c96].
Thanks for your contribution [~duanzhengqiang] .
> UDF without parameters cannot be validated when use default conformance
> -----------------------------------------------------------------------
>
> Key: CALCITE-6745
> URL: https://issues.apache.org/jira/browse/CALCITE-6745
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.39.0
> Reporter: hongyu guo
> Assignee: Zhengqiang Duan
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.39.0
>
>
> Reproduce:
> {code:java}
> public static void main(String[] args) throws Exception {
> Schema schema = new AbstractSchema() {
> @Override
> protected Map<String, Table> getTableMap() {
> return Map.of();
> }
> };
> Properties info = new Properties();
>
> info.setProperty(CalciteConnectionProperty.DEFAULT_NULL_COLLATION.camelName(),
> NullCollation.LAST.name());
>
> info.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(),
> "false");
> Connection connection = DriverManager.getConnection("jdbc:calcite:",
> info);
> CalciteConnection calciteConnection =
> connection.unwrap(CalciteConnection.class);
> SchemaPlus rootSchema = calciteConnection.getRootSchema();
> rootSchema.add("test", schema);
> rootSchema.add("TEST_FUNC", ScalarFunctionImpl.create(Main.class,
> "testFunc"));
> Statement stat = connection.createStatement();
> ResultSet resultSet = stat.executeQuery("select test_func()");
> resultSet.next();
> String res = resultSet.getString(1);
> System.out.println(res);
> }
> public static String testFunc() {
> return "testFunc";
> }
> {code}
> This demo can run in Calcite 1.38.0, but will throw exceptions in the main
> branch version of Calcite.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)