MaxGekk commented on a change in pull request #25410: [SPARK-28690][SQL] Add 
`date_part` function for timestamps/dates
URL: https://github.com/apache/spark/pull/25410#discussion_r314586539
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
 ##########
 @@ -1963,3 +1963,77 @@ case class Epoch(child: Expression, timeZoneId: 
Option[String] = None)
     defineCodeGen(ctx, ev, c => s"$dtu.getEpoch($c, $zid)")
   }
 }
+
+@ExpressionDescription(
+  usage = "_FUNC_(field, source) - Extracts a part of the date/timestamp.",
+  arguments = """
+    Arguments:
+      * field - selects which part of the source should be extracted. 
Supported string values 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"]
 
 Review comment:
   Sounds good. I will do that.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

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

Reply via email to