[GitHub] [spark] dilipbiswal commented on a change in pull request #28951: [SPARK-32131][SQL] union and set operations have wrong exception infomation

2020-06-29 Thread GitBox


dilipbiswal commented on a change in pull request #28951:
URL: https://github.com/apache/spark/pull/28951#discussion_r447426571



##
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
##
@@ -831,4 +831,77 @@ class AnalysisSuite extends AnalysisTest with Matchers {
   }
 }
   }
+
+  test("SPARK-32131 Fix wrong column index when we have more than two columns" 
+
+" during union and set operations" ) {
+val firstTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", FloatType)())
+
+val secondTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", TimestampType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", FloatType)())
+
+val thirdTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", TimestampType)(),
+  AttributeReference("d", FloatType)())
+
+val fourthTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", TimestampType)())
+
+val a1 = firstTable.output(0)
+val b1 = firstTable.output(1)
+val c1 = firstTable.output(2)
+val d1 = firstTable.output(3)
+
+val a2 = secondTable.output(0)
+val b2 = secondTable.output(1)
+val c2 = secondTable.output(2)
+val d2 = secondTable.output(3)
+
+val a3 = thirdTable.output(0)

Review comment:
   ditto

##
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
##
@@ -831,4 +831,77 @@ class AnalysisSuite extends AnalysisTest with Matchers {
   }
 }
   }
+
+  test("SPARK-32131 Fix wrong column index when we have more than two columns" 
+
+" during union and set operations" ) {
+val firstTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", FloatType)())
+
+val secondTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", TimestampType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", FloatType)())
+
+val thirdTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", TimestampType)(),
+  AttributeReference("d", FloatType)())
+
+val fourthTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", TimestampType)())
+
+val a1 = firstTable.output(0)
+val b1 = firstTable.output(1)
+val c1 = firstTable.output(2)
+val d1 = firstTable.output(3)
+
+val a2 = secondTable.output(0)
+val b2 = secondTable.output(1)
+val c2 = secondTable.output(2)
+val d2 = secondTable.output(3)
+
+val a3 = thirdTable.output(0)
+val b3 = thirdTable.output(1)
+val c3 = thirdTable.output(2)
+val d3 = thirdTable.output(3)
+
+val a4 = fourthTable.output(0)

Review comment:
   ditto





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:
us...@infra.apache.org



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



[GitHub] [spark] dilipbiswal commented on a change in pull request #28951: [SPARK-32131][SQL] union and set operations have wrong exception infomation

2020-06-29 Thread GitBox


dilipbiswal commented on a change in pull request #28951:
URL: https://github.com/apache/spark/pull/28951#discussion_r447426485



##
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
##
@@ -831,4 +831,77 @@ class AnalysisSuite extends AnalysisTest with Matchers {
   }
 }
   }
+
+  test("SPARK-32131 Fix wrong column index when we have more than two columns" 
+
+" during union and set operations" ) {
+val firstTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", FloatType)())
+
+val secondTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", TimestampType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", FloatType)())
+
+val thirdTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", TimestampType)(),
+  AttributeReference("d", FloatType)())
+
+val fourthTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", TimestampType)())
+
+val a1 = firstTable.output(0)

Review comment:
   @GuoPhilipse Variables a1, b1, c1, d1 not used ? Were you planning to 
use it in the test later ?





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:
us...@infra.apache.org



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



[GitHub] [spark] dilipbiswal commented on a change in pull request #28951: [SPARK-32131][SQL] union and set operations have wrong exception infomation

2020-06-29 Thread GitBox


dilipbiswal commented on a change in pull request #28951:
URL: https://github.com/apache/spark/pull/28951#discussion_r447426527



##
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
##
@@ -831,4 +831,77 @@ class AnalysisSuite extends AnalysisTest with Matchers {
   }
 }
   }
+
+  test("SPARK-32131 Fix wrong column index when we have more than two columns" 
+
+" during union and set operations" ) {
+val firstTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", FloatType)())
+
+val secondTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", TimestampType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", FloatType)())
+
+val thirdTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", TimestampType)(),
+  AttributeReference("d", FloatType)())
+
+val fourthTable = LocalRelation(
+  AttributeReference("a", StringType)(),
+  AttributeReference("b", DoubleType)(),
+  AttributeReference("c", IntegerType)(),
+  AttributeReference("d", TimestampType)())
+
+val a1 = firstTable.output(0)
+val b1 = firstTable.output(1)
+val c1 = firstTable.output(2)
+val d1 = firstTable.output(3)
+
+val a2 = secondTable.output(0)

Review comment:
   ditto





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:
us...@infra.apache.org



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