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

[GitHub] spark pull request: [SPARK-13321][SQL] Add nested union test cases

Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11361#discussion_r58171387
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala ---
    @@ -426,4 +428,68 @@ class PlanParserSuite extends PlanTest {
           "Number of aliases must match the number of fields in an inline table.")
         intercept[ArrayIndexOutOfBoundsException](parsePlan("values (1, 'a'), (2, 'b', 5Y)"))
       }
    +
    +  test("nesting UNION") {
    +    val parsed = parsePlan(
    +      """
    +       |SELECT  `u_1`.`id` FROM (((SELECT  `t0`.`id` FROM `default`.`t0`)
    +       |UNION ALL (SELECT  `t0`.`id` FROM `default`.`t0`)) UNION ALL
    +       |(SELECT  `t0`.`id` FROM `default`.`t0`)) AS u_1
    +      """.stripMargin)
    +
    +    val expected = Project(
    --- End diff --
    
    Minor: @viirya could you update this use the DSL and `assertEqual` equals? It makes this a bit easier to read. 
    
    BTW this test is very similar to the following test case: https://github.com/apache/spark/blob/master/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala#L384-L392


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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