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

    https://github.com/apache/spark/pull/11550#discussion_r61663994
  
    --- 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 --
    
    actually i think inferField is too long and makes it less clear what's 
going on. The old way looks better.



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