dongjoon-hyun commented on a change in pull request #25388: [SPARK-28656][SQL] 
Support `millennium`, `century` and `decade` at `extract()`
URL: https://github.com/apache/spark/pull/25388#discussion_r312238761
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
 ##########
 @@ -1810,3 +1810,83 @@ case class MakeTimestamp(
 
   override def prettyName: String = "make_timestamp"
 }
+
+@ExpressionDescription(
+  usage = "_FUNC_(date) - Returns the millennium of the date/timestamp.",
+  examples = """
+    Examples:
+      > SELECT _FUNC_('2000-01-19');
+       2
+      > SELECT _FUNC_('2019-08-06');
+       3
+  """,
+  since = "3.0.0")
+case class Millennium(child: Expression) extends UnaryExpression with 
ImplicitCastInputTypes {
 
 Review comment:
   Could you update the title since this PR adds these function beyond 
`EXTRACT` syntax?

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