Add support for TRY to expression matcher
@@ -30,6 +30,7 @@ import com.facebook.presto.sql.tree.Node;
import com.facebook.presto.sql.tree.NotExpression;
import com.facebook.presto.sql.tree.StringLiteral;
import com.facebook.presto.sql.tree.SymbolReference;
+import com.facebook.presto.sql.tree.TryExpression;
import java.util.List;
@@ -77,6 +78,16 @@ final class ExpressionVerifier
throw new IllegalStateException(format("Node %s is not supported", node));
}
+ @Override
+ protected Boolean visitTryExpression(TryExpression actual, Expression expected)
+ {
+ if (!(expected instanceof TryExpression)) {
+ return false;
+ }
+
+ return process(actual.getInnerExpression(), ((TryExpression) expected).getInnerExpression());
+ }
+
@Override
protected Boolean visitCast(Cast actual, Expression expectedExpression)
{
