cloud-fan commented on a change in pull request #31549:
URL: https://github.com/apache/spark/pull/31549#discussion_r578406521
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala
##########
@@ -486,34 +485,49 @@ object PartitioningUtils {
val timestampValue = Cast(Literal(unescapedRaw), TimestampType,
Some(zoneId.getId)).eval()
// Disallow TimestampType if the cast returned null
require(timestampValue != null)
- Literal.create(timestampValue, TimestampType)
+ TimestampType
}
- if (typeInference) {
+ val dataType = if (typeInference) {
Review comment:
instead of
```
val dataType = if ... {
...
}
dataType
```
we can just write
```
if ... {
...
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]