Skip to content

Conversation

@viirya
Copy link
Member

@viirya viirya commented Jan 12, 2026

Implement pushdown for LIKE predicates with simple prefix patterns (e.g., 'prefix%') to Iceberg's StartsWith operator. This optimization allows filtering to be performed at the storage layer, significantly improving query performance for prefix searches.

Changes:

  • Add support for Expr::Like in predicate conversion
  • Convert LIKE 'prefix%' patterns to StartsWith operator
  • Convert NOT LIKE 'prefix%' patterns to NotStartsWith operator
  • Handle edge cases: empty prefix, unicode, special characters
  • Reject complex patterns that cannot be pushed down (wildcards in middle, underscore, ILIKE)
  • Add 8 comprehensive unit tests covering various scenarios

Implementation details:

  • Only simple prefix patterns ending with % are converted
  • Patterns with % or _ wildcards in the prefix are not pushed down
  • Case-insensitive LIKE (ILIKE) is not supported for pushdown
  • Escape characters are not supported for pushdown
  • Works seamlessly with other predicates in AND/OR expressions

Which issue does this PR close?

  • Closes #.

What changes are included in this PR?

Are these changes tested?

Implement pushdown for LIKE predicates with simple prefix patterns (e.g., 'prefix%')
to Iceberg's StartsWith operator. This optimization allows filtering to be performed
at the storage layer, significantly improving query performance for prefix searches.

Changes:
- Add support for Expr::Like in predicate conversion
- Convert LIKE 'prefix%' patterns to StartsWith operator
- Convert NOT LIKE 'prefix%' patterns to NotStartsWith operator
- Handle edge cases: empty prefix, unicode, special characters
- Reject complex patterns that cannot be pushed down (wildcards in middle, underscore, ILIKE)
- Add 8 comprehensive unit tests covering various scenarios

Implementation details:
- Only simple prefix patterns ending with % are converted
- Patterns with % or _ wildcards in the prefix are not pushed down
- Case-insensitive LIKE (ILIKE) is not supported for pushdown
- Escape characters are not supported for pushdown
- Works seamlessly with other predicates in AND/OR expressions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant