Skip to content

Commit 7587c15

Browse files
Zhiying12rschlussel
authored andcommitted
Fix error classification for array with null elements
1 parent fdc6e65 commit 7587c15

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

presto-main-base/src/main/java/com/facebook/presto/execution/SqlQueryExecution.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import com.facebook.airlift.concurrent.SetThreadName;
1717
import com.facebook.presto.Session;
18+
import com.facebook.presto.common.InvalidFunctionArgumentException;
1819
import com.facebook.presto.common.analyzer.PreparedQuery;
1920
import com.facebook.presto.common.resourceGroups.QueryType;
2021
import com.facebook.presto.cost.CostCalculator;
@@ -97,6 +98,7 @@
9798
import static com.facebook.presto.execution.buffer.OutputBuffers.BROADCAST_PARTITION_ID;
9899
import static com.facebook.presto.execution.buffer.OutputBuffers.createInitialEmptyOutputBuffers;
99100
import static com.facebook.presto.execution.buffer.OutputBuffers.createSpoolingOutputBuffers;
101+
import static com.facebook.presto.spi.StandardErrorCode.INVALID_FUNCTION_ARGUMENT;
100102
import static com.facebook.presto.spi.StandardErrorCode.NOT_SUPPORTED;
101103
import static com.facebook.presto.sql.Optimizer.PlanStage.OPTIMIZED_AND_VALIDATED;
102104
import static com.facebook.presto.sql.planner.PlanNodeCanonicalInfo.getCanonicalInfo;
@@ -620,6 +622,9 @@ private PlanRoot doCreateLogicalPlanAndOptimize()
620622
catch (StackOverflowError e) {
621623
throw new PrestoException(NOT_SUPPORTED, "statement is too large (stack overflow during analysis)", e);
622624
}
625+
catch (InvalidFunctionArgumentException e) {
626+
throw new PrestoException(INVALID_FUNCTION_ARGUMENT, e.getMessage(), e);
627+
}
623628
}
624629

625630
private PlanRoot runCreateLogicalPlanAsync()

0 commit comments

Comments
 (0)