0lai0 commented on code in PR #4693:
URL: https://github.com/apache/datafusion-comet/pull/4693#discussion_r3445796284


##########
spark/src/main/scala/org/apache/comet/serde/datetime.scala:
##########
@@ -289,13 +290,26 @@ object CometSecond extends CometExpressionSerde[Second] 
with CodegenDispatchFall
   }
 }
 
+private[serde] object DatetimeCollation extends CometTypeShim {
+  def reason(functionName: String): String =
+    s"$functionName does not support non-UTF8_BINARY collations " +
+      "(https://github.com/apache/datafusion-comet/issues/4646)"
+
+  def hasNonDefaultCollation(expr: Expression): Boolean =
+    expr.children.exists(c => hasNonDefaultStringCollation(c.dataType))
+}
+
 object CometUnixTimestamp extends CometExpressionSerde[UnixTimestamp] {
 
+  private val collationReason = DatetimeCollation.reason("unix_timestamp")
+
   override def getUnsupportedReasons(): Seq[String] = Seq(
     "Only `TimestampType` and `DateType` inputs are supported." +
       " `TimestampNTZType` is not supported because Comet incorrectly applies 
timezone" +
       " conversion to TimestampNTZ values.")
 
+  override def getIncompatibleReasons(): Seq[String] = Seq(collationReason)

Review Comment:
   Sure, makes sense! I will move it into `CometTypeShim` so the reason appears 
only on 4.x, just as `hasNonDefaultStringCollation` is already shimmed. 
   
   I'll push an update shortly. Thanks for review



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

Reply via email to