You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/11/04 09:25:36 UTC

[GitHub] [spark] amanomer commented on a change in pull request #26293: [SPARK-29595][SQL] Insertion with named_struct should match by name

amanomer commented on a change in pull request #26293: [SPARK-29595][SQL] Insertion with named_struct should match by name
URL: https://github.com/apache/spark/pull/26293#discussion_r341955374
 
 

 ##########
 File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DataSourceV2AnalysisSuite.scala
 ##########
 @@ -535,14 +535,10 @@ abstract class DataSourceV2AnalysisBaseSuite extends AnalysisTest {
       val parsedPlan = byPosition(tableWithStructCol, query)
       assertNotResolved(parsedPlan)
 
-      val expectedQuery = Project(Seq(Alias(
-        Cast(
-          query.output.head,
-          new StructType().add("a", IntegerType).add("b", IntegerType),
-          Some(conf.sessionLocalTimeZone)),
-        "col")()),
-        query)
-      checkAnalysis(parsedPlan, byPosition(tableWithStructCol, expectedQuery))
+      assertAnalysisError(parsedPlan, Seq(
+        "Cannot write incompatible data to table", "'table-name'",
+        "Struct 'col' 0-th field name does not match", "expected 'a', found 'x'",
+        "Struct 'col' 1-th field name does not match", "expected 'b', found 'y'"))
 
 Review comment:
   @maropu Review this fix.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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