Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/22123#discussion_r211283824 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVDataSource.scala --- @@ -227,10 +210,9 @@ object TextInputCSVDataSource extends CSVDataSource { // Note: if there are only comments in the first block, the header would probably // be not extracted. CSVUtils.extractHeader(lines, parser.options).foreach { header => - CSVDataSource.checkHeader( - header, - parser.tokenizer, - dataSchema, + CSVDataSource.checkHeaderColumnNames( + if (columnPruning) requiredSchema else dataSchema, + parser.tokenizer.parseLine(header), --- End diff -- Nit: the following code style is preferred. ``` val schema = if (columnPruning) requiredSchema else dataSchema val columnNames = parser.tokenizer.parseLine(header) ... ```
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org