Skip to content

[VL] Support partial fallback generic unmapped catalyst expressions #12486

Open
taiyang-li wants to merge 6 commits into
apache:mainfrom
taiyang-li:liyang/fallback-generic-unmapped-catalyst-expr
Open

[VL] Support partial fallback generic unmapped catalyst expressions #12486
taiyang-li wants to merge 6 commits into
apache:mainfrom
taiyang-li:liyang/fallback-generic-unmapped-catalyst-expr

Conversation

@taiyang-li

@taiyang-li taiyang-li commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

ColumnarPartialProject previously did not recognize generic unmapped catalyst expressions shipped in user jars. When such a custom catalyst expression was not registered in ExpressionMappings, it was not identified for partial-project fallback and could still reach native expression conversion and fail at runtime.

This patch makes Velox detect those generic unmapped catalyst expressions earlier and route them through ColumnarPartialProject fallback. ScalaUDF and Hive UDF keep using their existing dedicated paths instead of being folded into the generic fallback path.

How was this patch tested?

  • Added a Velox unit test with a custom DummyUnmappedExpr in UDFPartialProjectSuite

Does this PR introduce any user-facing change?

No.

Was this patch authored or co-authored using generative AI tooling?

Yes.
Generated-by: OpenAI GPT-5

@github-actions github-actions Bot added the VELOX label Jul 9, 2026
@taiyang-li taiyang-li changed the title [MINOR][VL] Fallback generic unmapped catalyst expressions via partial project [VL] Support partial fallback generic unmapped catalyst expressions Jul 9, 2026
…l project

Support custom catalyst expressions from user jars in ColumnarPartialProject when Velox cannot map them natively, while keeping ScalaUDF and HiveUDF on their existing fallback paths.
Keep the new generic unmapped catalyst expression note concise while preserving the intent of the fallback behavior.
@taiyang-li taiyang-li force-pushed the liyang/fallback-generic-unmapped-catalyst-expr branch from e567ad0 to 6b98127 Compare July 12, 2026 06:30
@github-actions github-actions Bot added the CORE works for Gluten Core label Jul 13, 2026
@zzcclp

zzcclp commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Will this pr affect the CH backend? Can some UT be added to the CH backend?

@taiyang-li

Copy link
Copy Markdown
Contributor Author

Will this pr affect the CH backend? Can some UT be added to the CH backend?

No. Only codes in velox backend modified.

For Velox backend, I add 2 extra testGluten() uts and disable 2 original test() uts in spark4.0 and spark4.1. And it shouldn't have affect on CH backend.

@taiyang-li

Copy link
Copy Markdown
Contributor Author

@zhouyuan @rui-mo can you help review this pr?


class GlutenVariantSuite extends VariantSuite with GlutenSQLTestsTrait {}
class GlutenVariantSuite extends VariantSuite with GlutenSQLTestsTrait {
testGluten("non-literal variant_get") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we won't test it in Spark 4.0, can we remote it?

@taiyang-li taiyang-li Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image I saw `GlutenVariantSuite` was enabled in spark4.0 VeloxTestSettings.scala. Do I miss something?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is excluded in your PR.

expr.deterministic &&
!expr.isInstanceOf[Unevaluable] &&
!expr.isInstanceOf[LambdaFunction] &&
!ExpressionMappings.expressionsMap.contains(expr.getClass)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to consider the ExpressionConverter.tryTransformWithoutExpressionMapping whole check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE works for Gluten Core VELOX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants