Github user ted-yu commented on the pull request:

    https://github.com/apache/spark/pull/9862#issuecomment-158551264
  
    With
    ```
    diff --git 
a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala 
b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
    index dd6d065..fedb0df 100644
    --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
    +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
    @@ -378,6 +378,15 @@ class DataFrameSuite extends QueryTest with 
SharedSQLContext {
         assert(df.schema.map(_.name) === Seq("value"))
       }
    
    +  test("drop columns using drop") {
    +    val src = Seq((1,2,3)).toDF("a", "b", "c")
    +    val df = src.drop("a", "b")
    +    checkAnswer(
    +      df,
    +      src.collect().map(x => Row(x.getInt(1))).toSeq)
    +    assert(df.schema.map(_.name) === Seq("c"))
    +  }
    +
       test("drop unknown column (no-op)") {
         val df = testData.drop("random")
         checkAnswer(
    ```
    I got:
    ```
    - drop columns using drop *** FAILED ***
      Results do not match for query:
      == Parsed Logical Plan ==
      'Project [unresolvedalias('c)]
       Project [b#134,c#135]
        Project [_1#130 AS a#133,_2#131 AS b#134,_3#132 AS c#135]
         LocalRelation [_1#130,_2#131,_3#132], [[1,2,3]]
    
      == Analyzed Logical Plan ==
      c: int
      Project [c#135]
       Project [b#134,c#135]
        Project [_1#130 AS a#133,_2#131 AS b#134,_3#132 AS c#135]
         LocalRelation [_1#130,_2#131,_3#132], [[1,2,3]]
    
      == Optimized Logical Plan ==
      LocalRelation [c#135], [[3]]
    
      == Physical Plan ==
      LocalTableScan [c#135], [[3]]
      == Results ==
      !== Correct Answer - 1 ==   == Spark Answer - 1 ==
      ![2]                        [3] (QueryTest.scala:126)
    ```
    Some hint ?



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