You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2023/08/29 07:28:59 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #42393: [SPARK-43438][SQL] Error on missing input columns in `INSERT`

MaxGekk commented on code in PR #42393:
URL: https://github.com/apache/spark/pull/42393#discussion_r1308340551


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala:
##########
@@ -88,37 +86,24 @@ object TableOutputResolver {
     if (actualExpectedCols.size < query.output.size) {
       throw QueryCompilationErrors.cannotWriteTooManyColumnsToTableError(
         tableName, actualExpectedCols.map(_.name), query)
+    } else if (actualExpectedCols.size > query.output.size && !byName) {
+      throw QueryCompilationErrors.cannotWriteNotEnoughColumnsToTableError(
+        tableName, actualExpectedCols.map(_.name), query)
     }
 
     val errors = new mutable.ArrayBuffer[String]()
     val resolved: Seq[NamedExpression] = if (byName) {
       // If a top-level column does not have a corresponding value in the input query, fill with
-      // the column's default value. We need to pass `fillDefaultValue` as true here, if the
-      // `supportColDefaultValue` parameter is also true.
+      // the column's default value.
       reorderColumnsByName(
         tableName,
         query.output,
         actualExpectedCols,
         conf,
         errors += _,
-        fillDefaultValue = supportColDefaultValue)

Review Comment:
   reverted back



-- 
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