Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/22367#discussion_r216196589
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVInferSchema.scala
---
@@ -79,7 +79,8 @@ private[csv] object CSVInferSchema {
* point checking if it is an Int, as the final type must be Double or
higher.
*/
def inferField(typeSoFar: DataType, field: String, options: CSVOptions):
DataType = {
- if (field == null || field.isEmpty || field == options.nullValue) {
+ if (field == null || field.isEmpty || field == options.nullValue ||
+ field == options.emptyValueInRead) {
--- End diff --
Also, this will exclude empty strings from type inference. Wonder if that
makes sense. Let's target this change for 3.0.0 if you feel in the similar way.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]