Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/5278#discussion_r27462667
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
---
@@ -41,6 +41,30 @@ case class NestedArray1(a: NestedArray2)
*/
class SQLQuerySuite extends QueryTest {
+ test("SPARK-5371: union with null and sum") {
+ val df = Seq((1,1)).toDF("c1", "c2")
+ df.registerTempTable("table1")
+
+ val query = sql(
+ """
+ |SELECT
+ | MIN(c1),
+ | MIN(c2)
+ |FROM (
+ | SELECT
+ | SUM(c1) c1,
+ | NULL c2
+ | FROM table1
+ | UNION ALL
+ | SELECT
+ | NULL c1,
+ | SUM(c2) c2
+ | FROM table1
+ |) a
+ """.stripMargin)
+ checkAnswer(query, Row(1,1) :: Nil)
+ }
+
test("explode nested Field") {
Seq(NestedArray1(NestedArray2(Seq(1,2,3)))).toDF.registerTempTable("nestedArray")
--- End diff --
Same as above (although not part of this PR).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]