cloud-fan commented on a change in pull request #28248:
URL: https://github.com/apache/spark/pull/28248#discussion_r411085373



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
##########
@@ -2130,38 +2129,38 @@ object DatePartLike {
   }
 }
 
+// scalastyle:off line.size.limit
 @ExpressionDescription(
   usage = "_FUNC_(field, source) - Extracts a part of the date/timestamp or 
interval source.",
   arguments = """
     Arguments:
       * field - selects which part of the source should be extracted.
-               Supported string values of `field` for dates and timestamps are:
-                ["MILLENNIUM", ("MILLENNIA", "MIL", "MILS"),
-                 "CENTURY", ("CENTURIES", "C", "CENT"),
-                 "DECADE", ("DECADES", "DEC", "DECS"),
-                 "YEAR", ("Y", "YEARS", "YR", "YRS"),
-                 "ISOYEAR",
-                 "QUARTER", ("QTR"),
-                 "MONTH", ("MON", "MONS", "MONTHS"),
-                 "WEEK", ("W", "WEEKS"),
-                 "DAY", ("D", "DAYS"),
-                 "DAYOFWEEK",
-                 "DOW",
-                 "ISODOW",
-                 "DOY",
-                 "HOUR", ("H", "HOURS", "HR", "HRS"),
-                 "MINUTE", ("M", "MIN", "MINS", "MINUTES"),
-                 "SECOND", ("S", "SEC", "SECONDS", "SECS"),
-                 "MILLISECONDS", ("MSEC", "MSECS", "MILLISECON", "MSECONDS", 
"MS"),
-                 "MICROSECONDS", ("USEC", "USECS", "USECONDS", "MICROSECON", 
"US"),
-                 "EPOCH"]
-                Supported string values of `field` for intervals are:
-                 ["YEAR", ("Y", "YEARS", "YR", "YRS"),
-                  "MONTH", ("MON", "MONS", "MONTHS"),
-                  "DAY", ("D", "DAYS"),
-                  "HOUR", ("H", "HOURS", "HR", "HRS"),
-                  "MINUTE", ("M", "MIN", "MINS", "MINUTES"),
-                  "SECOND", ("S", "SEC", "SECONDS", "SECS")]
+          - Supported string values of `field` for dates and timestamps are:
+              - "MILLENNIUM", ("MILLENNIA", "MIL", "MILS") - the conventional 
numbering of millennia
+              - "CENTURY", ("CENTURIES", "C", "CENT") - the conventional 
numbering of centuries
+              - "DECADE", ("DECADES", "DEC", "DECS") - the year field divided 
by 1
+              - "YEAR", ("Y", "YEARS", "YR", "YRS") - the year field
+              - "ISOYEAR" - the ISO 8601 week-numbering year that the datetime 
falls in
+              - "QUARTER", ("QTR") - the quarter (1 - 4) of the year that the 
datetime falls in
+              - "MONTH", ("MON", "MONS", "MONTHS") - the month field
+              - "WEEK", ("W", "WEEKS") - the number of the ISO 8601 
week-of-week-based-year. A week is considered to start on a Monday and week 1 
is the first week with >3 days. In the ISO week-numbering system, it is 
possible for early-January dates to be part of the 52nd or 53rd week of the 
previous year, and for late-December dates to be part of the first week of the 
next year. For example, 2005-01-02 is part of the 53rd week of year 2004, while 
2012-12-31 is part of the first week of 2013
+              - "DAY", ("D", "DAYS") - the day of the month field (1 - 31)
+              - "DAYOFWEEK",("DOW") - the day of the week for datetime as 
Sunday(1) to Saturday(7)
+              - "ISODOW" - ISO 8601 based day of the week for datetime as 
Monday(1) to Sunday(7)
+              - "DOY" - the day of the year (1 - 365/366)
+              - "HOUR", ("H", "HOURS", "HR", "HRS") - The hour field (0 - 23)
+              - "MINUTE", ("M", "MIN", "MINS", "MINUTES") - the minutes field 
(0 - 59)
+              - "SECOND", ("S", "SEC", "SECONDS", "SECS") - the seconds field, 
including fractional parts
+              - "MILLISECONDS", ("MSEC", "MSECS", "MILLISECON", "MSECONDS", 
"MS") - the seconds field, including fractional parts, multiplied by 1000. Note 
that this includes full seconds
+              - "MICROSECONDS", ("USEC", "USECS", "USECONDS", "MICROSECON", 
"US") - The seconds field, including fractional parts, multiplied by 1000000. 
Note that this includes full seconds
+              - "EPOCH" - the number of seconds with fractional part in 
microsecond precision since 1970-01-01 00:00:00 local time (can be negative)
+          - Supported string values of `field` for interval(which consists of 
`months`, `days`, `microseconds`) are:
+              - "YEAR", ("Y", "YEARS", "YR", "YRS") - the total `months` / 12
+              - "MONTH", ("MON", "MONS", "MONTHS") - the total `months` modulo 
12

Review comment:
       ```
   the total `months` % 12
   ```
   to be consistent with
   ```
   the total `months` / 12
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to