use of org.apache.calcite.test.CalciteAssert.ConnectionPostProcessor in project calcite by apache.
the class ScannableTableTest method newSchema.
protected ConnectionPostProcessor newSchema(final String schemaName, final String tableName, final Table table) {
return new ConnectionPostProcessor() {
@Override
public Connection apply(Connection connection) throws SQLException {
CalciteConnection con = connection.unwrap(CalciteConnection.class);
SchemaPlus rootSchema = con.getRootSchema();
SchemaPlus schema = rootSchema.add(schemaName, new AbstractSchema());
schema.add(tableName, table);
connection.setSchema(schemaName);
return connection;
}
};
}
Aggregations