Skip to content

feat(isthmus): support EXISTS and UNIQUE set predicates #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

nielspardon
Copy link
Contributor

Should be merged after #353 since it shares the same test infrastructure.

Currently, the Substrait to Calcite mappings do not support exists and unique set predicates like the follow SQL example from TPC-H query no. 4:

select
  o.o_orderpriority,
  count(*) as order_count
from
  "orders" o

where
  o.o_orderdate >= date '1996-10-01'
  and o.o_orderdate < date '1996-10-01' + interval '3' month
  and
  exists (
    select
      *
    from
      "lineitem" l
    where
      l.l_orderkey = o.o_orderkey
      and l.l_commitdate < l.l_receiptdate
  )
group by
  o.o_orderpriority
order by
  o.o_orderpriority

This PR adds support for mapping exists and unique set predicates from Substrait into Calcite and adds a test case showing that it works now.

@nielspardon nielspardon force-pushed the par-set-predicate branch 5 times, most recently from 9292b21 to 2502697 Compare March 26, 2025 20:12
Copy link
Member

@vbarua vbarua 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 overall. Left one minor usability improvment.

Signed-off-by: Niels Pardon <par@zurich.ibm.com>
@vbarua vbarua changed the title feat(isthmus): support exists and unique set predicates feat(isthmus): support EXISTS and UNIQUE set predicates Mar 27, 2025
@vbarua vbarua merged commit 424e8b3 into substrait-io:main Mar 27, 2025
13 checks passed
@nielspardon nielspardon deleted the par-set-predicate branch April 7, 2025 12:41
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.

2 participants