Skip to content

[GLUTEN-12266][FLINK] Fix UnsatisfiedLinkError when IN predicate uses strin…#12267

Open
ggjh-159 wants to merge 1 commit into
apache:mainfrom
ggjh-159:fix/planner-in-predicate-jni
Open

[GLUTEN-12266][FLINK] Fix UnsatisfiedLinkError when IN predicate uses strin…#12267
ggjh-159 wants to merge 1 commit into
apache:mainfrom
ggjh-159:fix/planner-in-predicate-jni

Conversation

@ggjh-159

@ggjh-159 ggjh-159 commented Jun 9, 2026

Copy link
Copy Markdown

related issue: #12266

What changes are proposed in this pull request?

Fix two bugs in RexNodeConverter.java that break IN predicate with string values in Gluten-Flink planner.

ConstantTypedExpr.create(Variant) calls StaticJniApi.variantInferType() via JNI to infer type, but the planner runs in SQL client process where native library is not loaded, causing UnsatisfiedLinkError. The type is already available from relDataType, so we use the 3-arg constructor to pass it directly.

NlsString.toString() returns SQL display format (e.g. "_UTF-16LE'apple'") instead of raw string, causing the serialized IN list to contain malformed values that never match. Fix by checking instanceof NlsString and calling getValue().

Note: A companion fix in velox4j is also needed for REGEXP_EXTRACT returning empty string instead of NULL on no match. See bigo-sg/velox4j #31.

How was this patch tested?

Manual test. Tested by running Nexmark Q21 on Gluten-Flink with 10000 events. Previously crashed at submission with UnsatisfiedLinkError. After this fix, the query submits successfully and produces correct results (8754 output rows matching Flink native execution).

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

@ggjh-159

Copy link
Copy Markdown
Author

@philo-he @lgbo-ustc @zhanglistar @KevinyhZou Would you mind reviewing this PR?

@philo-he philo-he left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants