public class TableResolution
extends java.lang.Object
Constructor and Description |
---|
TableResolution() |
Modifier and Type | Method and Description |
---|---|
static org.apache.calcite.schema.Table |
resolveCalciteTable(org.apache.calcite.plan.Context context,
org.apache.calcite.schema.SchemaPlus schemaPlus,
java.util.List<java.lang.String> tablePath)
Returns Calcite Table by consulting the schema.
|
public static org.apache.calcite.schema.Table resolveCalciteTable(org.apache.calcite.plan.Context context, org.apache.calcite.schema.SchemaPlus schemaPlus, java.util.List<java.lang.String> tablePath)
The way the schema is queried is defined by the name resolution strategey implemented by a TableResolver and stored as a TableResolutionContext in the context.
If no custom table resolution logic is provided, default one is used, which is: drill down the getSubschema() path until the second-to-last path element. We expect the path to be a table path, so the last element should be a valid table id, we don't expect anything else there.
This resembles a default Calcite planner strategy. One difference is that Calcite doesn't assume the last element is a table and will continue to call getSubschema(), making it impossible for a table provider to understand the context.