coderfender commented on code in PR #4660:
URL: https://github.com/apache/datafusion-comet/pull/4660#discussion_r3423382454
##########
spark/src/main/scala/org/apache/comet/serde/unixtime.scala:
##########
@@ -30,11 +30,19 @@ import
org.apache.comet.serde.QueryPlanSerde.{exprToProtoInternal, optExprWithFa
object CometFromUnixTime extends CometExpressionSerde[FromUnixTime] with
CodegenDispatchFallback {
override def getIncompatibleReasons(): Seq[String] = Seq(
- "Only supports the default datetime format pattern `yyyy-MM-dd HH:mm:ss`."
+
- " DataFusion's valid timestamp range differs from Spark" +
+ "DataFusion's valid timestamp range differs from Spark" +
" (https://github.com/apache/datafusion/issues/16594)")
- override def getSupportLevel(expr: FromUnixTime): SupportLevel =
Incompatible(None)
+ override def getUnsupportedReasons(): Seq[String] = Seq(
+ "Only the default datetime format pattern `yyyy-MM-dd HH:mm:ss` is
supported.")
+
+ override def getSupportLevel(expr: FromUnixTime): SupportLevel = {
+ if (expr.format != Literal(TimestampFormatter.defaultPattern())) {
+ Unsupported(Some("Only the default datetime pattern `yyyy-MM-dd
HH:mm:ss` is supported"))
+ } else {
+ Incompatible(None)
Review Comment:
We might wnat to add some SQL tests to verify the fallback and make sure the
plan is annotated
##########
spark/src/main/scala/org/apache/comet/serde/unixtime.scala:
##########
@@ -48,7 +56,7 @@ object CometFromUnixTime extends
CometExpressionSerde[FromUnixTime] with Codegen
val formatExpr = exprToProtoInternal(Literal("%Y-%m-%d %H:%M:%S"), inputs,
binding)
val timeZone = exprToProtoInternal(Literal(expr.timeZoneId.orNull),
inputs, binding)
- if (expr.format != Literal(TimestampFormatter.defaultPattern)) {
+ if (expr.format != Literal(TimestampFormatter.defaultPattern())) {
Review Comment:
nit : might be an unwanted change ?
--
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]