File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions
core/src/test/scala/org/apache/spark/sql Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff 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_();
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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" ,
You can’t perform that action at this time.
0 commit comments