private Connection getConnectionWithMultiplyFunction()
throws ClassNotFoundException, SQLException {
Connection connection =
DriverManager.getConnection("jdbc:calcite:");
CalciteConnection calciteConnection =
connection.unwrap(CalciteConnection.class);
SchemaPlus rootSchema = calciteConnection.getRootSchema();
SchemaPlus schema = rootSchema.add("s", new AbstractSchema());
final TableFunction table =
TableFunctionImpl.create(Smalls.MULTIPLICATION_TABLE_METHOD);
schema.add("multiplication", table);
return connection;
}
|