You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "metanil (via GitHub)" <gi...@apache.org> on 2026/06/03 23:39:55 UTC

Re: [PR] [SPARK-50593][SQL] SPJ: Support truncate transform via generalized ReducibleFunction API [spark]

metanil commented on code in PR #55885:
URL: https://github.com/apache/spark/pull/55885#discussion_r3352543435


##########
sql/core/src/test/scala/org/apache/spark/sql/connector/catalog/functions/transformFunctions.scala:
##########
@@ -253,20 +287,88 @@ object StringSelfFunction extends ScalarFunction[UTF8String] {
 }
 
 object UnboundTruncateFunction extends UnboundFunction {
-  override def bind(inputType: StructType): BoundFunction = TruncateFunction
+  override def bind(inputType: StructType): BoundFunction = {
+    if (inputType.size == 2) {
+      inputType.head.dataType match {
+        case StringType | BinaryType => TruncateFunction

Review Comment:
   @peter-toth fixed Removed unsupported datatype in the test. Also I converted IntegerTruncateFunction with proper reducible method, along with new unit test for it.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org