Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.39.0
Description
Reproduce:
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"; }
This demo can run in Calcite 1.38.0, but will throw exceptions in the main branch version of Calcite.
Attachments
Issue Links
- is caused by
-
CALCITE-6645 Support user-defined function without parentheses when db dialect's allowNiladicParentheses property is false
-
- Closed
-
- links to