Copilot commented on code in PR #12486:
URL: https://github.com/apache/gluten/pull/12486#discussion_r3594955836
##########
backends-velox/src/test/scala/org/apache/gluten/expression/UDFPartialProjectSuite.scala:
##########
@@ -64,7 +79,54 @@ class UDFPartialProjectSuite extends
WholeStageTransformerSuite {
spark.udf.register("no_argument", noArgument)
val concat = udf((x: String) => x + "_concat")
spark.udf.register("concat_concat", concat)
+ spark.sessionState.functionRegistry.registerFunction(
+ FunctionIdentifier("dummy_unmapped"),
+ new ExpressionInfo(classOf[DummyUnmappedExpr].getName, "dummy_unmapped"),
+ (children: Seq[Expression]) => DummyUnmappedExpr(children.head)
+ )
Review Comment:
The custom function builder uses `children.head` without validating arity.
If the function is called with 0 args (or analysis rewrites it unexpectedly),
this will throw `NoSuchElementException` and obscure the real error. Add an
explicit arity check with a clear message before accessing the first child.
##########
gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxTestSettings.scala:
##########
@@ -863,6 +863,7 @@ class VeloxTestSettings extends BackendTestSettings {
enableSuite[GlutenVariantSuite]
// TODO: Velox parquet writer marks all struct fields as OPTIONAL
(nullable),
// but Spark's variant type requires REQUIRED fields. Needs Velox-side
fix.
+ .exclude("non-literal variant_get")
.exclude("SPARK-47546: invalid variant binary")
Review Comment:
PR description focuses on partial-project fallback for unmapped Catalyst
expressions, but this PR also adds Variant and HLL-related tests/exclusions
(e.g., `GlutenVariantSuite` new test plus a new exclude here, and
`GlutenDataFrameAggregateSuite` HLL negative tests plus a new exclude). Please
update the PR description to cover these additional changes, or split them into
a separate PR to keep scope/intent clear for reviewers and release notes.
--
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]