Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16757#discussion_r99869104
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantAliasAndProjectSuite.scala
 ---
    @@ -40,8 +45,8 @@ class RemoveAliasOnlyProjectSuite extends PlanTest with 
PredicateHelper {
     
       test("all expressions in project list are aliased child output but with 
different order") {
         val relation = LocalRelation('a.int, 'b.int)
    -    val query = relation.select('b as 'b, 'a as 'a).analyze
    -    val optimized = Optimize.execute(query)
    +    val query = relation.select('b, 'a).analyze
    +    val optimized = Optimize.execute(relation.select('b as 'b, 'a as 
'a).analyze)
    --- End diff --
    
    according to most of the optimizer unit tests, the preferred code style 
should be
    ```
    val query = relation.select('b as 'b, 'a as 'a).analyze
    val optimized = Optimize.execute(query)
    val expected = relation.select('b, 'a).analyze
    comparePlans(optimized, expected)
    ```


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

Reply via email to