Skip to content

Conversation

@Nithurshen
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

Currently, DataFusion fails to consume Substrait plans that utilize like_match, like_imatch, or their negated variants (like_not_match, like_not_imatch). This results in a panic with DataFusion error: This feature is not implemented: Unsupported function name: "like_match" during round-trip planning.

This PR implements the missing mapping logic in the Substrait consumer to correctly translate these function names into DataFusion Expr::Like expressions.

What changes are included in this PR?

  • Updated BuiltinExprBuilder in scalar_function.rs to recognize:
    • like_match (LIKE)
    • like_imatch (ILIKE)
    • like_not_match (NOT LIKE)
    • like_not_imatch (NOT ILIKE)
  • Modified the internal build_like_expr helper to accept a negated boolean flag (previously hardcoded to false).
  • Added a new unit test test_like_match_conversion to verify the correct conversion of these functions and their arguments.

Are these changes tested?

Yes. I added a new unit test test_like_match_conversion in datafusion/substrait/src/logical_plan/consumer/expr/scalar_function.rs.

This test explicitly constructs Substrait plans for like_match and like_not_match and asserts that they are consumed into correct DataFusion Expr::Like variants with the appropriate negated and case_insensitive flags.

Note: Verification was done via unit test rather than the standard sqllogictest suite because predicates.slt was experiencing unrelated environment-specific failures locally.

Are there any user-facing changes?

  • No breaking changes.
  • Users relying on Substrait round-trips for LIKE/ILIKE expressions will now see these queries succeed instead of failing.

@github-actions github-actions bot added the substrait Changes to the substrait crate label Nov 25, 2025
Copy link
Contributor

@milenkovicm milenkovicm left a comment

Choose a reason for hiding this comment

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

thanks @Nithurshen PR makes sense

@Nithurshen
Copy link
Contributor Author

@milenkovicm, Can we merge this PR as all the tests have passed.

@milenkovicm
Copy link
Contributor

lets leave time for others to comment.
maybe @gabotechs would like to have a look as he opened original issue

Copy link
Contributor

@gabotechs gabotechs left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @Nithurshen for the PR and @milenkovicm for the review!

@gabotechs gabotechs added this pull request to the merge queue Nov 27, 2025
Merged via the queue into apache:main with commit fb14d7c Nov 27, 2025
27 checks passed
@Nithurshen Nithurshen deleted the fix/substrait-like-support branch November 28, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

substrait Changes to the substrait crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[substrait] [sqllogictest] Unsupported function name: "like_match", "like_imatch", "like_not_match" and "like_not_imatch"

3 participants