comphead commented on code in PR #2634:
URL: https://github.com/apache/datafusion-comet/pull/2634#discussion_r2479263580
##########
spark/src/main/scala/org/apache/comet/serde/datetime.scala:
##########
@@ -256,6 +259,24 @@ object CometDateAdd extends
CometScalarFunction[DateAdd]("date_add")
object CometDateSub extends CometScalarFunction[DateSub]("date_sub")
object CometTruncDate extends CometExpressionSerde[TruncDate] {
+
+ val supportedFormats: Seq[String] =
+ Seq("year", "yyyy", "yy", "quarter", "mon", "month", "mm", "week")
Review Comment:
The list of possible formats are:
fmt - the format representing the unit to be truncated to
"YEAR", "YYYY", "YY" - truncate to the first date of the year that the ts
falls in, the time part will be zero out
"QUARTER" - truncate to the first date of the quarter that the ts falls in,
the time part will be zero out
"MONTH", "MM", "MON" - truncate to the first date of the month that the ts
falls in, the time part will be zero out
"WEEK" - truncate to the Monday of the week that the ts falls in, the time
part will be zero out
"DAY", "DD" - zero out the time part
"HOUR" - zero out the minute and second with fraction part
"MINUTE"- zero out the second with fraction part
"SECOND" - zero out the second fraction part
"MILLISECOND" - zero out the microseconds
"MICROSECOND" - everything remains
Am I missing a reason why Comet doesn't support smaller than week formats?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]