Fix categorization for security errors during view analysis
@@ -194,6 +194,7 @@ import static com.facebook.presto.sql.tree.WindowFrame.Type.RANGE;
import static com.facebook.presto.type.UnknownType.UNKNOWN;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
+import static com.google.common.base.Throwables.throwIfInstanceOf;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.Iterables.getLast;
import static com.google.common.collect.Iterables.transform;
@@ -1886,6 +1887,7 @@ class StatementAnalyzer
return queryScope.getRelationType().withAlias(name.getObjectName(), null);
}
catch (RuntimeException e) {
+ throwIfInstanceOf(e, PrestoException.class);
throw new SemanticException(VIEW_ANALYSIS_ERROR, node, "Failed analyzing stored view '%s': %s", name, e.getMessage());
}
}
