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

    https://github.com/apache/spark/pull/20894#discussion_r190148356
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVDataSource.scala
 ---
    @@ -118,6 +121,64 @@ object CSVDataSource {
           TextInputCSVDataSource
         }
       }
    +
    +  /**
    +   * Checks that column names in a CSV header and field names in the 
schema are the same
    +   * by taking into account case sensitivity.
    +   */
    +  def checkHeaderColumnNames(
    +      schema: StructType,
    +      columnNames: Array[String],
    +      fileName: String,
    +      enforceSchema: Boolean,
    +      caseSensitive: Boolean): Unit = {
    +    if (!enforceSchema && columnNames != null) {
    --- End diff --
    
    Probably, you mean when `enforceSchema` is `true` (we forcibly apply the 
schema to data), we should output warnings. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to