Repository navigation
Add UnsupportedOp for unsupported predicate sub-expressions - #983
Merged
Merged
Conversation
chakankardb
force-pushed
the
abh_hierp
branch
4 times, most recently
from
July 8, 2026 14:33
579ff55 to
500668b
Compare
Co-authored-by: Isaac
linzhou-db
previously approved these changes
Jul 10, 2026
Co-authored-by: Isaac
linzhou-db
approved these changes
Jul 10, 2026
1 of 5 tasks
murali-db
pushed a commit
to delta-io/delta
that referenced
this pull request
Nov 17, 2026
âĶredicate hints (#8109) #### Which Delta project/connector is this regarding? - [ ] Spark - [ ] Standalone - [ ] Flink - [ ] Kernel - [x] Other (Sharing) ## Description When a delta-format Delta Sharing query has one filter that can't be converted to a json predicate (e.g. `RLIKE`/`LIKE`, or a large `IN` list, which the optimizer turns into `InSet`), `OpConverter` throws. The whole partition-filter or data-filter hint is then dropped, so the sharing server can't skip any files and returns the full file list, even though the other filters could have been used for skipping. `DeltaSharingJsonPredicates.convert` now honors `spark.delta.sharing.jsonPredicateHints.partialFilter.enabled`. That conf, and partial conversion in `OpConverter`, shipped in delta-sharing-client 1.4.1 (delta-io/delta-sharing#983), and the parquet-format path (`RemoteDeltaFileIndex`) already uses them. When the conf is on, `OpConverter` emits `UnsupportedOp` placeholders, and `UnsupportedOpPruner` removes them before the hint is serialized: - An AND keeps its supported children. - An OR or NOT that contains an unsupported node is dropped whole. So the hint still matches a superset of the files with matching rows, and `UnsupportedOp` is never sent to the server. The conf applies to both the partition and the data side of the hint. It defaults to `false`, so behavior is unchanged unless it is enabled. ## How was this patch tested? New `DeltaSharingFileIndexSuite` test "jsonPredicate partial filter drops only unsupported sub-expressions". It pins the three hint confs and asserts the exact json hint sent to the server: - With the conf off, an unsupported `RLIKE` or a 21-value `IN` still drops the whole data-filter side, as before. - With the conf on: - an unsupported AND conjunct (`RLIKE`, `InSet`, or a 21-value `IN`) is dropped while the supported partition and data conjuncts are kept; - an OR containing an unsupported branch is dropped entirely; - a predicate with nothing supported sends no hint; - fully supported predicates produce the same hint as before. Each check also asserts that exactly one file-listing call was made, so a missing hint can't come from a cache hit. ## Does this PR introduce _any_ user-facing changes? No. The behavior only changes when `spark.delta.sharing.jsonPredicateHints.partialFilter.enabled` is set to `true` (default `false`). With it on, queries with unsupported filters can get server-side file skipping from their remaining filters. This pull request and its description were written by Isaac. --------- Signed-off-by: Abhijit Chakankar <abhijit.chakankar@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously OpConverter threw IllegalArgumentException for unsupported SQL expressions (e.g. nested struct field access via GetStructField), causing the entire predicate to be dropped. This prevented pruning even when other parts of the predicate (e.g. AND siblings) were fully supported.
Instead, this change uses UnsupportedOp for unsupported sub-expressions, and then prunes away parts of expression tree based on them. This preserves the compound predicate structure so that supported siblings can still drive file pruning. UnsupportedOp evaluates conservatively to true (never prunes), which is propagated up via AND/OR/NOT. The UnsupportOp stays local to this client, and is never sent back to the server.
The change is guarded behind a flag.