Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/11550#discussion_r61663987
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVInferSchema.scala
---
@@ -78,7 +79,63 @@ private[csv] object CSVInferSchema {
* Infer type of string field. Given known type Double, and a string
"1", there is no
* point checking if it is an Int, as the final type must be Double or
higher.
*/
- def inferField(typeSoFar: DataType, field: String, nullValue: String =
""): DataType = {
+ def inferField(typeSoFar: DataType,
+ field: String,
+ nullValue: String = "",
+ dateFormat: SimpleDateFormat = null): DataType = {
+ def tryParseInteger(field: String): DataType = if ((allCatch opt
field.toInt).isDefined) {
--- End diff --
it'd be great in the future to make the prs more precise, i.e. avoid moving
code around just for the sake of moving them around. It makes a lot more time
consuming for review.
---
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]