spark-instrumented-optimizer/sql/catalyst/src/main
Maxim Gekk a529be2930 [SPARK-27212][SQL] Eliminate TimeZone to ZoneId conversion in stringToTimestamp
## What changes were proposed in this pull request?

In the PR, I propose to avoid the `TimeZone` to `ZoneId` conversion in `DateTimeUtils.stringToTimestamp` by changing signature of the method, and require a parameter of `ZoneId` type. This will allow to avoid unnecessary conversion (`TimeZone` -> `String` -> `ZoneId`) per each row.

Also the PR avoids creation of `ZoneId` instances from `ZoneOffset` because `ZoneOffset` is a sub-class, and the conversion is unnecessary too.

## How was this patch tested?

It was tested by `DateTimeUtilsSuite` and `CastSuite`.

Closes #24155 from MaxGekk/stringtotimestamp-zoneid.

Authored-by: Maxim Gekk <maxim.gekk@databricks.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
2019-03-22 18:01:29 +09:00
..
antlr4/org/apache/spark/sql/catalyst/parser [SPARK-26946][SQL] Identifiers for multi-catalog 2019-03-21 18:04:50 -07:00
java/org/apache/spark/sql [SPARK-26946][SQL] Identifiers for multi-catalog 2019-03-21 18:04:50 -07:00
scala/org/apache/spark/sql [SPARK-27212][SQL] Eliminate TimeZone to ZoneId conversion in stringToTimestamp 2019-03-22 18:01:29 +09:00