public PhysicalPlan getPlan(SqlNode node) throws ValidationException, RelConversionException, IOException {
SqlNode sqlNode = rewrite(node);
SqlNode validated = validateNode(sqlNode);
RelNode rel = convertToRel(validated);
log("Optiq Logical", rel);
DrillRel drel = convertToDrel(rel);
log("Drill Logical", drel);
if (mode == ResultMode.LOGICAL) {
LogicalExplain logicalResult = new LogicalExplain(drel, level, context);
return DirectPlan.createDirectPlan(context, logicalResult);