andygrove commented on code in PR #4693:
URL: https://github.com/apache/datafusion-comet/pull/4693#discussion_r3444122643


##########
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:
   minor nit: this incompatibility will get documented for all Spark versions 
even though it is specific to Spark 4.x
   
   I wonder if we can shim `getIncompatibleReasons` so it only applies for 4.x?



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