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

    https://github.com/apache/spark/pull/22123#discussion_r210801081
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala
 ---
    @@ -1603,6 +1603,44 @@ class CSVSuite extends QueryTest with 
SharedSQLContext with SQLTestUtils with Te
           .exists(msg => msg.getRenderedMessage.contains("CSV header does not 
conform to the schema")))
       }
     
    +  test("SPARK-25134: check header on parsing of dataset with projection 
and column pruning") {
    +    withSQLConf(SQLConf.CSV_PARSER_COLUMN_PRUNING.key -> "true") {
    +      withTempPath { path =>
    +        val dir = path.getAbsolutePath
    +        Seq(("a", "b")).toDF("columnA", "columnB").write
    +          .format("csv")
    +          .option("header", true)
    +          .save(dir)
    +        checkAnswer(spark.read
    +          .format("csv")
    +          .option("header", true)
    +          .option("enforceSchema", false)
    +          .load(dir)
    +          .select("columnA"),
    +          Row("a"))
    +      }
    +    }
    +  }
    +
    +  test("SPARK-25134: check header on parsing of dataset with projection 
and no column pruning") {
    +    withSQLConf(SQLConf.CSV_PARSER_COLUMN_PRUNING.key -> "false") {
    --- End diff --
    
    ok will remove


---

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

Reply via email to