@@ -85,8 +85,8 @@ private[sql] object JDBCRelation extends Logging {
85
85
val (column, columnType) = verifyAndGetNormalizedPartitionColumn(
86
86
schema, partitionColumn.get, resolver, jdbcOptions)
87
87
88
- val lowerBoundValue = toInternalBoundValue(lowerBound.get, columnType)
89
- val upperBoundValue = toInternalBoundValue(upperBound.get, columnType)
88
+ val lowerBoundValue = toInternalBoundValue(lowerBound.get, columnType, timeZoneId )
89
+ val upperBoundValue = toInternalBoundValue(upperBound.get, columnType, timeZoneId )
90
90
JDBCPartitioningInfo (
91
91
column, columnType, lowerBoundValue, upperBoundValue, numPartitions.get)
92
92
}
@@ -174,7 +174,10 @@ private[sql] object JDBCRelation extends Logging {
174
174
(dialect.quoteIdentifier(column.name), column.dataType)
175
175
}
176
176
177
- private def toInternalBoundValue (value : String , columnType : DataType ): Long = {
177
+ private def toInternalBoundValue (
178
+ value : String ,
179
+ columnType : DataType ,
180
+ timeZoneId : String ): Long = {
178
181
def parse [T ](f : UTF8String => Option [T ]): T = {
179
182
f(UTF8String .fromString(value)).getOrElse {
180
183
throw new IllegalArgumentException (
@@ -184,8 +187,7 @@ private[sql] object JDBCRelation extends Logging {
184
187
columnType match {
185
188
case _ : NumericType => value.toLong
186
189
case DateType => parse(stringToDate).toLong
187
- case TimestampType =>
188
- parse(stringToTimestamp(_, getTimeZone(SQLConf .get.sessionLocalTimeZone)))
190
+ case TimestampType => parse(stringToTimestamp(_, getTimeZone(timeZoneId)))
189
191
}
190
192
}
191
193
0 commit comments