use of org.apache.calcite.schema.TableFactory in project calcite by apache.
the class ModelHandler method visit.
public void visit(JsonCustomTable jsonTable) {
try {
checkRequiredAttributes(jsonTable, "name", "factory");
final SchemaPlus schema = currentMutableSchema("table");
final TableFactory tableFactory = AvaticaUtils.instantiatePlugin(TableFactory.class, jsonTable.factory);
final Table table = tableFactory.create(schema, jsonTable.name, operandMap(null, jsonTable.operand), null);
for (JsonColumn column : jsonTable.columns) {
column.accept(this);
}
schema.add(jsonTable.name, table);
} catch (Exception e) {
throw new RuntimeException("Error instantiating " + jsonTable, e);
}
}
Aggregations