andygrove opened a new pull request, #4333:
URL: https://github.com/apache/datafusion-comet/pull/4333

   ## Which issue does this PR close?
   
   No specific issue. Stacked follow-on to #4325.
   
   ## Rationale for this change
   
   #4325 ("Move most of \`comet-common\` module into \`comet-spark\`") was 
motivated in part by removing the Arrow shading boundary so that contributors 
writing \`CometUDF\` implementations in the spark module can use Arrow types 
directly without hitting \`ClassCastException\` at runtime.
   
   This PR proves the refactor unblocks that use case by adding a small 
\`DateFormat\` \`CometUDF\` and a ScalaTest suite that drives it directly. The 
test allocates Arrow vectors, populates them, calls the UDF, and validates the 
formatted output.
   
   Production routing of \`DateFormatClass\` continues to go through 
\`CometDateFormat\` to DataFusion's \`to_char\` scalar function. The UDF added 
here is for framework validation only.
   
   ## What changes are included in this PR?
   
   - \`spark/src/main/scala/org/apache/comet/udf/builtin/DateFormatUdf.scala\`: 
a \`CometUDF\` that formats a date column using 
\`java.time.format.DateTimeFormatter\`. Allocates its output via the shared 
\`CometArrowAllocator\`.
   - \`spark/src/test/scala/org/apache/comet/udf/DateFormatUdfSuite.scala\`: 
ScalaTest suite exercising the UDF SPI directly. Does not yet drive the JNI 
bridge or the native \`JvmScalarUdfExpr\` path.
   
   ## How are these changes tested?
   
   ScalaTest suite included. Local run:
   
   \`\`\`
   DateFormatUdfSuite:
   - formats dates with yyyy-MM-dd pattern, propagates nulls (340 ms)
   All tests passed.
   \`\`\`
   
   > Note: depends on #4325. Diff currently includes the parent branch's 
commits; once #4325 lands, this branch will rebase to a single-commit diff.


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