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

    https://github.com/apache/spark/pull/14279#discussion_r75233570
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVOptions.scala
 ---
    @@ -101,11 +102,9 @@ private[csv] class CSVOptions(@transient private val 
parameters: Map[String, Str
         name.map(CompressionCodecs.getCodecClassName)
       }
     
    -  // Share date format object as it is expensive to parse date pattern.
    -  val dateFormat: SimpleDateFormat = {
    -    val dateFormat = parameters.get("dateFormat")
    -    dateFormat.map(new SimpleDateFormat(_)).orNull
    -  }
    +  // Uses `FastDateFormat` which can be direct replacement for 
`SimpleDateFormat` and thread-safe.
    +  val dateFormat: FastDateFormat =
    --- End diff --
    
    you should just always set this, and always use this variable, rather than 
having an if branch later to check whether this is null.



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