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

    https://github.com/apache/spark/pull/11550#discussion_r61664186
  
    --- 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 --
    
    I see.. Actually, I did not move them for no reason. It was becuase 
`tryParseTimestamp()` refers `dateFormat` but did not want to add another 
argument.
    Anyway, let me make this like the original but taking another argument 
(`CSVOptions`).


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