Skip to content

Commit b591ff7

Browse files
committed
address comment
1 parent 73f71c5 commit b591ff7

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ trait TimestampFormatterHelper extends TimeZoneAwareExpression {
7474
}
7575

7676
@ExpressionDescription(
77-
usage = "_FUNC_() - Returns the current timezone.",
77+
usage = "_FUNC_() - Returns the current session local timezone.",
7878
examples = """
7979
Examples:
8080
> SELECT _FUNC_();

sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,8 +1950,10 @@ class DatasetSuite extends QueryTest
19501950

19511951
test("SPARK-33469: Add current_timezone function") {
19521952
val df = Seq(1).toDF("c")
1953-
val timezone = df.selectExpr("current_timezone()").collect().head.getString(0)
1954-
assert(timezone == SQLConf.get.sessionLocalTimeZone)
1953+
withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> "Asia/Shanghai") {
1954+
val timezone = df.selectExpr("current_timezone()").collect().head.getString(0)
1955+
assert(timezone == "Asia/Shanghai")
1956+
}
19551957
}
19561958
}
19571959

sql/core/src/test/scala/org/apache/spark/sql/expressions/ExpressionInfoSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ class ExpressionInfoSuite extends SparkFunSuite with SharedSparkSession {
149149
"org.apache.spark.sql.catalyst.expressions.UnixTimestamp",
150150
"org.apache.spark.sql.catalyst.expressions.CurrentDate",
151151
"org.apache.spark.sql.catalyst.expressions.CurrentTimestamp",
152-
"org.apache.spark.sql.catalyst.expressions.Now",
153152
"org.apache.spark.sql.catalyst.expressions.CurrentTimeZone",
153+
"org.apache.spark.sql.catalyst.expressions.Now",
154154
// Random output without a seed
155155
"org.apache.spark.sql.catalyst.expressions.Rand",
156156
"org.apache.spark.sql.catalyst.expressions.Randn",

0 commit comments

Comments
 (0)