Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/13041#discussion_r62793802
--- 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
--- End diff --
I mean if the header is a empty string then, I think the field name should
be a empty string since apparently it works with fields named empty strings. I
tested this by manually giving a schema. If the header is used for schema, then
I think the names should be as they are. We don't really change field names
specified in ORC, Parquet or JSON.
---
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]