You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
+28-32Lines changed: 28 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -2135,36 +2135,32 @@ object DatePartLike {
2135
2135
arguments ="""
2136
2136
Arguments:
2137
2137
* 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`
2168
2164
* source - a date/timestamp or interval column from where `field` should be extracted
2169
2165
""",
2170
2166
examples ="""
@@ -2183,7 +2179,7 @@ object DatePartLike {
2183
2179
30.001001
2184
2180
""",
2185
2181
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`
2187
2183
""",
2188
2184
since ="3.0.0")
2189
2185
// scalastyle:on line.size.limit
@@ -2224,7 +2220,7 @@ case class DatePart(field: Expression, source: Expression, child: Expression)
2224
2220
30.001001
2225
2221
""",
2226
2222
note ="""
2227
-
The _FUNC_ function is equivalent to `date_part`. See <a href="#date_part">date_part</a> for detail.
0 commit comments