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

    https://github.com/apache/spark/pull/13041#discussion_r62920728
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/DefaultSource.scala
 ---
    @@ -61,7 +61,9 @@ class DefaultSource extends FileFormat with 
DataSourceRegister {
         val firstRow = new LineCsvReader(csvOptions).parseLine(firstLine)
     
         val header = if (csvOptions.headerFlag) {
    -      firstRow
    +      firstRow.zipWithIndex.map { case (value, index) =>
    +        if (value == "" || value == null) s"C$index" else value
    +      }
         } else {
           firstRow.zipWithIndex.map { case (value, index) => s"C$index" }
    --- End diff --
    
    I talked to @marmbrus offline. 
[Elsewhere](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/catalyst/SQLBuilder.scala#L523)
 we use `_c0` instead of `C0`, so we should make that consistent. You're gonna 
have to change the name both here and in L65.


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