You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "itholic (via GitHub)" <gi...@apache.org> on 2023/09/01 02:38:23 UTC

[GitHub] [spark] itholic commented on a diff in pull request #39937: [SPARK-42309][SQL] Introduce `INCOMPATIBLE_DATA_TO_TABLE` and sub classes.

itholic commented on code in PR #39937:
URL: https://github.com/apache/spark/pull/39937#discussion_r1312472174


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala:
##########
@@ -78,11 +80,11 @@ object TableOutputResolver {
           tableName, actualExpectedCols.map(_.name), query)
       }
 
-      resolveColumnsByPosition(queryOutputCols, actualExpectedCols, conf, errors += _)
+      resolveColumnsByPosition(tableName, queryOutputCols, actualExpectedCols, conf, errors += _)
     }
 
     if (errors.nonEmpty) {
-      throw QueryCompilationErrors.cannotWriteIncompatibleDataToTableError(tableName, errors.toSeq)
+      resolveColumnsByPosition(tableName, query.output, actualExpectedCols, conf, errors += _)
     }

Review Comment:
   Thanks for catching this. I think this is a mistake, so we should just throw error directly here.
   Just made a follow-up for fixing this: https://github.com/apache/spark/pull/42762



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org