From d89d22319e050e02dc84147feb023774228243ca Mon Sep 17 00:00:00 2001 From: Max Gekk Date: Thu, 28 Dec 2023 14:41:21 +0300 Subject: [PATCH] Convert NPE and asserts from commands to internal errors --- .../org/apache/spark/sql/execution/QueryExecution.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala index eb5b38d42881..a2cfad800e00 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala @@ -114,8 +114,11 @@ class QueryExecution( // for eagerly executed commands we mark this place as beginning of execution. tracker.setReadyForExecution() val qe = sparkSession.sessionState.executePlan(c, CommandExecutionMode.NON_ROOT) - val result = SQLExecution.withNewExecutionId(qe, Some(commandExecutionName(c))) { - qe.executedPlan.executeCollect() + val name = commandExecutionName(c) + val result = QueryExecution.withInternalError(s"Eagerly executed $name failed.") { + SQLExecution.withNewExecutionId(qe, Some(name)) { + qe.executedPlan.executeCollect() + } } CommandResult( qe.analyzed.output,