This is an automated email from the ASF dual-hosted git repository. wenchen pushed a commit to branch branch-3.0 in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.0 by this push: new bd99994 [SPARK-31232][SQL][DOCS] Specify formats of `spark.sql.session.timeZone` bd99994 is described below commit bd999943866e9dcc1a67222f6d46e97e1726d96e Author: Maxim Gekk <max.g...@gmail.com> AuthorDate: Wed Mar 25 16:32:28 2020 +0800 [SPARK-31232][SQL][DOCS] Specify formats of `spark.sql.session.timeZone` In the PR, I propose to update the doc for `spark.sql.session.timeZone`, and restrict format of config's values to 2 forms: 1. Geographical regions, such as `America/Los_Angeles`. 2. Fixed offsets - a fully resolved offset from UTC. For example, `-08:00`. Other formats such as three-letter time zone IDs are ambitious, and depend on the locale. For example, `CST` could be U.S. `Central Standard Time` and `China Standard Time`. Such formats have been already deprecated in JDK, see [Three-letter time zone IDs](https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html). No By running `./dev/scalastyle`, and manual testing. Closes #27999 from MaxGekk/doc-session-time-zone. Authored-by: Maxim Gekk <max.g...@gmail.com> Signed-off-by: Wenchen Fan <wenc...@databricks.com> (cherry picked from commit 27d53de10faa907a53a979b66282a457767b33ba) Signed-off-by: Wenchen Fan <wenc...@databricks.com> --- .../scala/org/apache/spark/sql/internal/SQLConf.scala | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala index 9681a5d..1b00bed 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala @@ -1507,13 +1507,16 @@ object SQLConf { Try { DateTimeUtils.getZoneId(zone) }.isSuccess } - val SESSION_LOCAL_TIMEZONE = - buildConf("spark.sql.session.timeZone") - .doc("""The ID of session local timezone, e.g. "GMT", "America/Los_Angeles", etc.""") - .stringConf - .checkValue(isValidTimezone, s"Cannot resolve the given timezone with" + - " ZoneId.of(_, ZoneId.SHORT_IDS)") - .createWithDefaultFunction(() => TimeZone.getDefault.getID) + val SESSION_LOCAL_TIMEZONE = buildConf("spark.sql.session.timeZone") + .doc("The ID of session local timezone in the format of either region-based zone IDs or " + + "zone offsets. Region IDs must have the form 'area/city', such as 'America/Los_Angeles'. " + + "Zone offsets must be in the format '(+|-)HH:mm', for example '-08:00' or '+01:00'. " + + "Also 'UTC' and 'Z' are supported as aliases of '+00:00'. Other short names are not " + + "recommended to use because they can be ambiguous.") + .stringConf + .checkValue(isValidTimezone, s"Cannot resolve the given timezone with" + + " ZoneId.of(_, ZoneId.SHORT_IDS)") + .createWithDefaultFunction(() => TimeZone.getDefault.getID) val WINDOW_EXEC_BUFFER_IN_MEMORY_THRESHOLD = buildConf("spark.sql.windowExec.buffer.in.memory.threshold") --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org