From 52b3b2d5bce31e528fe99b6adfe71cfe6b97f084 Mon Sep 17 00:00:00 2001 From: Gengliang Wang Date: Thu, 26 Aug 2021 18:27:33 +0800 Subject: [PATCH] [SPARK-36227][SQL][DOCS][3.2] Remove TimestampNTZ from API docs ### What changes were proposed in this pull request? Although we try to remove TimestampNTZ from Branch 3.2 in , it still shows up in our API doc: https://dist.apache.org/repos/dist/dev/spark/v3.2.0-rc1-docs/_site/api/scala/org/apache/spark/sql/types/TimestampNTZType.html https://dist.apache.org/repos/dist/dev/spark/v3.2.0-rc1-docs/_site/api/java/org/apache/spark/sql/types/DataType.html This PR is to clean it up in the API docs by * making the TimestampNTZ type private * remove TimestampNTZ in DataTypes The changes are only for branch 3.2. ### Why are the changes needed? Fix API doc ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Manually check generated docs Closes #33837 from gengliangwang/privateNTZ. Authored-by: Gengliang Wang Signed-off-by: Gengliang Wang --- .../main/java/org/apache/spark/sql/types/DataTypes.java | 5 ----- .../org/apache/spark/sql/types/TimestampNTZType.scala | 9 ++------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/sql/catalyst/src/main/java/org/apache/spark/sql/types/DataTypes.java b/sql/catalyst/src/main/java/org/apache/spark/sql/types/DataTypes.java index 9454c3c259..90a2baf130 100644 --- a/sql/catalyst/src/main/java/org/apache/spark/sql/types/DataTypes.java +++ b/sql/catalyst/src/main/java/org/apache/spark/sql/types/DataTypes.java @@ -54,11 +54,6 @@ public class DataTypes { */ public static final DataType TimestampType = TimestampType$.MODULE$; - /** - * Gets the TimestampNTZType object. - */ - public static final DataType TimestampNTZType = TimestampNTZType$.MODULE$; - /** * Gets the CalendarIntervalType object. */ diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/TimestampNTZType.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/TimestampNTZType.scala index 99c29e444c..03b975fb5f 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/TimestampNTZType.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/TimestampNTZType.scala @@ -29,10 +29,8 @@ import org.apache.spark.annotation.Unstable * To represent an absolute point in time, use `TimestampType` instead. * * Please use the singleton `DataTypes.TimestampNTZType` to refer the type. - * @since 3.3.0 */ -@Unstable -class TimestampNTZType private() extends AtomicType { +private[spark] class TimestampNTZType private() extends AtomicType { /** * Internally, a timestamp is stored as the number of microseconds from * the epoch of 1970-01-01T00:00:00.000000(Unix system time zero) @@ -58,8 +56,5 @@ class TimestampNTZType private() extends AtomicType { * the TimestampNTZType class. Otherwise, the companion object would be of type * "TimestampNTZType" in byte code. Defined with a private constructor so the companion * object is the only possible instantiation. - * - * @since 3.3.0 */ -@Unstable -case object TimestampNTZType extends TimestampNTZType +private[spark] case object TimestampNTZType extends TimestampNTZType