Skip to content

Commit 0b90597

Browse files
committed
address comments
1 parent fdb5467 commit 0b90597

File tree

1 file changed

+28
-32
lines changed

1 file changed

+28
-32
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,36 +2135,32 @@ object DatePartLike {
21352135
arguments = """
21362136
Arguments:
21372137
* field - selects which part of the source should be extracted.
2138-
<ul>
2139-
<b> Supported string values of `field` for dates and timestamps are: </b>
2140-
<li> "MILLENNIUM", ("MILLENNIA", "MIL", "MILS") - the conventional numbering of millennia </li>
2141-
<li> "CENTURY", ("CENTURIES", "C", "CENT") - the conventional numbering of centuries </li>
2142-
<li> "DECADE", ("DECADES", "DEC", "DECS") - the year field divided by 10 </li>
2143-
<li> "YEAR", ("Y", "YEARS", "YR", "YRS") - the year field </li>
2144-
<li> "ISOYEAR" - the ISO 8601 week-numbering year that the datetime falls in </li>
2145-
<li> "QUARTER", ("QTR") - the quarter (1 - 4) of the year that the datetime falls in </li>
2146-
<li> "MONTH", ("MON", "MONS", "MONTHS") - the month field </li>
2147-
<li> "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 </li>
2148-
<li> "DAY", ("D", "DAYS") - the day of the month field (1 - 31) </li>
2149-
<li> "DAYOFWEEK",("DOW") - the day of the week for datetime as Sunday(1) to Saturday(7) </li>
2150-
<li> "ISODOW" - ISO 8601 based day of the week for datetime as Monday(1) to Sunday(7) </li>
2151-
<li> "DOY" - the day of the year (1 - 365/366) </li>
2152-
<li> "HOUR", ("H", "HOURS", "HR", "HRS") - The hour field (0 - 23) </li>
2153-
<li> "MINUTE", ("M", "MIN", "MINS", "MINUTES") - the minutes field (0 - 59) </li>
2154-
<li> "SECOND", ("S", "SEC", "SECONDS", "SECS") - the seconds field, including fractional parts </li>
2155-
<li> "MILLISECONDS", ("MSEC", "MSECS", "MILLISECON", "MSECONDS", "MS") - the seconds field, including fractional parts, multiplied by 1000. Note that this includes full seconds </li>
2156-
<li> "MICROSECONDS", ("USEC", "USECS", "USECONDS", "MICROSECON", "US") - The seconds field, including fractional parts, multiplied by 1000000. Note that this includes full seconds </li>
2157-
<li> "EPOCH" - the number of seconds with fractional part in microsecond precision since 1970-01-01 00:00:00 local time (can be negative) </li>
2158-
</ul>
2159-
<ul>
2160-
<b> Supported string values of `field` for interval(which consists of `months`, `days`, `microseconds`) are: </b>
2161-
<li> "YEAR", ("Y", "YEARS", "YR", "YRS") - the total `months` / 12 </li>
2162-
<li> "MONTH", ("MON", "MONS", "MONTHS") - the total `months` modulo 12 </li>
2163-
<li> "DAY", ("D", "DAYS") - the `days` part of interval </li>
2164-
<li> "HOUR", ("H", "HOURS", "HR", "HRS") - how many hours the `microseconds` contains </li>
2165-
<li> "MINUTE", ("M", "MIN", "MINS", "MINUTES") - how many minutes left after taking hours from `microseconds` </li>
2166-
<li> "SECOND", ("S", "SEC", "SECONDS", "SECS") - how many second with fractions left after taking hours and minutes from `microseconds` </li>
2167-
</ul>
2138+
- Supported string values of `field` for dates and timestamps are:
2139+
- "MILLENNIUM", ("MILLENNIA", "MIL", "MILS") - the conventional numbering of millennia
2140+
- "CENTURY", ("CENTURIES", "C", "CENT") - the conventional numbering of centuries
2141+
- "DECADE", ("DECADES", "DEC", "DECS") - the year field divided by 1
2142+
- "YEAR", ("Y", "YEARS", "YR", "YRS") - the year field
2143+
- "ISOYEAR" - the ISO 8601 week-numbering year that the datetime falls in
2144+
- "QUARTER", ("QTR") - the quarter (1 - 4) of the year that the datetime falls in
2145+
- "MONTH", ("MON", "MONS", "MONTHS") - the month field
2146+
- "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
2147+
- "DAY", ("D", "DAYS") - the day of the month field (1 - 31)
2148+
- "DAYOFWEEK",("DOW") - the day of the week for datetime as Sunday(1) to Saturday(7)
2149+
- "ISODOW" - ISO 8601 based day of the week for datetime as Monday(1) to Sunday(7)
2150+
- "DOY" - the day of the year (1 - 365/366)
2151+
- "HOUR", ("H", "HOURS", "HR", "HRS") - The hour field (0 - 23)
2152+
- "MINUTE", ("M", "MIN", "MINS", "MINUTES") - the minutes field (0 - 59)
2153+
- "SECOND", ("S", "SEC", "SECONDS", "SECS") - the seconds field, including fractional parts
2154+
- "MILLISECONDS", ("MSEC", "MSECS", "MILLISECON", "MSECONDS", "MS") - the seconds field, including fractional parts, multiplied by 1000. Note that this includes full seconds
2155+
- "MICROSECONDS", ("USEC", "USECS", "USECONDS", "MICROSECON", "US") - The seconds field, including fractional parts, multiplied by 1000000. Note that this includes full seconds
2156+
- "EPOCH" - the number of seconds with fractional part in microsecond precision since 1970-01-01 00:00:00 local time (can be negative)
2157+
- Supported string values of `field` for interval(which consists of `months`, `days`, `microseconds`) are:
2158+
- "YEAR", ("Y", "YEARS", "YR", "YRS") - the total `months` / 12
2159+
- "MONTH", ("MON", "MONS", "MONTHS") - the total `months` modulo 12
2160+
- "DAY", ("D", "DAYS") - the `days` part of interval
2161+
- "HOUR", ("H", "HOURS", "HR", "HRS") - how many hours the `microseconds` contains
2162+
- "MINUTE", ("M", "MIN", "MINS", "MINUTES") - how many minutes left after taking hours from `microseconds`
2163+
- "SECOND", ("S", "SEC", "SECONDS", "SECS") - how many second with fractions left after taking hours and minutes from `microseconds`
21682164
* source - a date/timestamp or interval column from where `field` should be extracted
21692165
""",
21702166
examples = """
@@ -2183,7 +2179,7 @@ object DatePartLike {
21832179
30.001001
21842180
""",
21852181
note = """
2186-
The _FUNC_ function is equivalent to the SQL-standard function <a href="#extract">extract</a>
2182+
The _FUNC_ function is equivalent to the SQL-standard function `extract`
21872183
""",
21882184
since = "3.0.0")
21892185
// scalastyle:on line.size.limit
@@ -2224,7 +2220,7 @@ case class DatePart(field: Expression, source: Expression, child: Expression)
22242220
30.001001
22252221
""",
22262222
note = """
2227-
The _FUNC_ function is equivalent to `date_part`. See <a href="#date_part">date_part</a> for detail.
2223+
The _FUNC_ function is equivalent to `date_part`.
22282224
""",
22292225
since = "3.0.0")
22302226
// scalastyle:on line.size.limit

0 commit comments

Comments
 (0)