use of org.apache.calcite.sql.SqlExplain in project drill by apache.
the class ExplainHandler method rewrite.
@Override
public SqlNode rewrite(SqlNode sqlNode) throws RelConversionException, ForemanSetupException {
SqlExplain node = unwrap(sqlNode, SqlExplain.class);
SqlLiteral op = node.operand(2);
SqlExplain.Depth depth = (SqlExplain.Depth) op.getValue();
if (node.getDetailLevel() != null) {
level = node.getDetailLevel();
}
switch(depth) {
case LOGICAL:
mode = ResultMode.LOGICAL;
break;
case PHYSICAL:
mode = ResultMode.PHYSICAL;
break;
default:
throw new UnsupportedOperationException("Unknown depth " + depth);
}
return node.operand(0);
}
Aggregations