sadikovi commented on code in PR #36562:
URL: https://github.com/apache/spark/pull/36562#discussion_r874424921
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/CSVInferSchema.scala:
##########
@@ -178,7 +164,8 @@ class CSVInferSchema(val options: CSVOptions) extends
Serializable {
// We can only parse the value as TimestampNTZType if it does not have
zone-offset or
// time-zone component and can be parsed with the timestamp formatter.
// Otherwise, it is likely to be a timestamp with timezone.
- if ((allCatch opt timestampNTZFormatter.parseWithoutTimeZone(field,
false)).isDefined) {
+ val fieldAsUTF8String = UTF8String.fromString(field)
+ if
(DateTimeUtils.stringToTimestampWithoutTimeZone(fieldAsUTF8String).isDefined) {
Review Comment:
Yes, I left a similar comment above, we would like to retain the ability to
use options to configure timestamp format. One way to do it could be adding a
couple of more methods to TimestampFormatter trait to allow returning an option
where `None` means could not parse and `Some(value)` means parsing succeeded.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]