use of org.apache.calcite.materialize.MaterializationKey in project calcite by apache.
the class SqlDropMaterializedView method execute.
@Override
public void execute(CalcitePrepare.Context context) {
final Pair<CalciteSchema, String> pair = SqlDdlNodes.schema(context, true, name);
final Table table = pair.left.plus().getTable(pair.right);
if (table != null) {
// Materialized view exists.
super.execute(context);
if (table instanceof Wrapper) {
final MaterializationKey materializationKey = ((Wrapper) table).unwrap(MaterializationKey.class);
if (materializationKey != null) {
MaterializationService.instance().removeMaterialization(materializationKey);
}
}
}
}
Aggregations