From 99df7d75b715720ee72dfb1ca1048589c569b6e1 Mon Sep 17 00:00:00 2001 From: currantw Date: Wed, 15 Jan 2025 09:36:44 -0800 Subject: [PATCH] Remove duplicate documentation. Signed-off-by: currantw --- .../sql/expression/function/TimeUtils.java | 144 +----------------- 1 file changed, 1 insertion(+), 143 deletions(-) diff --git a/ppl-spark-integration/src/main/java/org/opensearch/sql/expression/function/TimeUtils.java b/ppl-spark-integration/src/main/java/org/opensearch/sql/expression/function/TimeUtils.java index 943368c5b..fff3ee78c 100644 --- a/ppl-spark-integration/src/main/java/org/opensearch/sql/expression/function/TimeUtils.java +++ b/ppl-spark-integration/src/main/java/org/opensearch/sql/expression/function/TimeUtils.java @@ -82,149 +82,7 @@ public class TimeUtils { /** * Returns the relative {@link ZonedDateTime} corresponding to the given relative string and zoned date time. - *

- * The relative time string has syntax {@code [+|-]@}, and - * is made up of two optional components: - *

- *

- * The special relative timestamp string {@code now}, corresponding to the current timestamp, is also supported. - *

- * The current timestamp is determined once at the start of query execution, and is used for all relative timestamp - * calculations for that query. The Spark session time zone ({@code spark.sql.session.timeZone}) is used for - * determining relative timestamps, and accounts for changes in the time zone offset (e.g. daylight savings time); - * as a result, adding one day ({@code +1d}) is not the same as adding twenty-four hours ({@code +24h}). - *

- * The relative timestamp string is case-insensitive. - *

- * The following offset time units are supported: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Time UnitSupported Keywords
Seconds{@code s}, {@code sec}, {@code secs}, {@code second}, {@code seconds}
Minutes{@code m}, {@code min}, {@code mins}, {@code minute}, {@code minutes}
Hours{@code h}, {@code hr}, {@code hrs}, {@code hour}, {@code hours}
Days{@code d}, {@code day}, {@code days}
Weeks{@code w}, {@code wk}, {@code wks}, {@code week}, {@code weeks}
Quarters{@code q}, {@code qtr}, {@code qtrs}, {@code quarter}, {@code quarters}
Years{@code y}, {@code yr}, {@code yrs}, {@code year}, {@code years}
- *

- * The snap-to time supports all the time units above, as well as the following day of the week time units: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Time UnitSupported Keywords
Sunday{@code w0}, {@code w7}
Monday{@code w1}
Tuesday{@code w2}
Wednesday{@code w3}
Thursday{@code w4}
Friday{@code w5}
Saturday{@code w6}
- *

- * For example, if the current timestamp is Monday, January 03, 2000 at 01:01:01 am: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Relative StringDescriptionResulting Relative Time
{@code -60m}Sixty minutes agoMonday, January 03, 2000 at 00:01:01 am
{@code -H}One hour agoMonday, January 03, 2000 at 00:01:01 am
{@code +2wk}Two weeks from nowMonday, January 17, 2000 at 00:01:01 am
{@code -1h@W3}One hour ago, rounded to the start of the previous WednesdayWednesday, December 29, 1999 at 00:00:00 am
{@code @d}Start of the current dayMonday, January 03, 2000 at 00:00:00 am
{@code now}NowMonday, January 03, 2000 at 01:01:01 am
+ * @see RELATIVE_TIMESTAMP for more details. */ public static ZonedDateTime getRelativeZonedDateTime(String relativeString, ZonedDateTime zonedDateTime) {