Github user dhunziker commented on a diff in the pull request:
https://github.com/apache/spark/pull/16812#discussion_r99951876
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/UnivocityParser.scala
---
@@ -110,7 +110,11 @@ private[csv] class UnivocityParser(
}
case _: BooleanType => (d: String) =>
- nullSafeDatum(d, name, nullable, options)(_.toBoolean)
+ nullSafeDatum(d, name, nullable, options) { datum =>
+ if (datum.equalsIgnoreCase(options.trueValue)) true
--- End diff --
Just seems more obvious that `datum` is guaranteed to be not null given the
name of `nullSafeDatum`. Probably should switch around the values in
`CSVInferSchema.scala`, since there, `field` is null checked at the beginning
of the parsing chain. Do you prefer one over the other?
---
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]