Skip to content

Register the set element operations in either operand order - #356

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:duck/generate-set-algebra-reversed
Aug 29, 2026
Merged

Register the set element operations in either operand order#356
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:duck/generate-set-algebra-reversed

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

MobilityDB declares setUnion, setMinus and setIntersection with the element on
either side, setIntersection(bigint, bigintset) beside setIntersection(bigintset,
bigint), and 162 such declarations across the three names. The generator carried
only the set-first order, so the scalar-first half reached no DuckDB row.

shape_set returns the reversed order as scset_set, the shape the bool-returning
branch above it already carries as the scset half of setsc/scset, and the
registration follows the C parameter order so the signature matches the body.
The emitted body marshals through SetToBlobN, so setMinus(3, '{3}'::intset)
answers NULL for the empty result as its set-first twin does.

Nineteen hand registrations of the same signatures, the scalar-first +, -, *
and || over a set, go with the change: the generator emits them, so the surface
they carry is unchanged while the named functions beside them are new. The
registered surface gains exactly those 19 names and loses none. setUnion of 5
and {1,3} answers {1, 3, 5}, setMinus of 5 and {1,3} answers {5},
setIntersection of 3 and {1,3} answers {3}, and setConcat of 'a' and {"b","c"}
answers {"ab", "ac"}.

MobilityDB declares setUnion, setMinus and setIntersection with the element on
either side, setIntersection(bigint, bigintset) beside setIntersection(bigintset,
bigint), and 162 such declarations across the three names. The generator carried
only the set-first order, so the scalar-first half reached no DuckDB row.

shape_set returns the reversed order as scset_set, the shape the bool-returning
branch above it already carries as the scset half of setsc/scset, and the
registration follows the C parameter order so the signature matches the body.
The emitted body marshals through SetToBlobN, so setMinus(3, '{3}'::intset)
answers NULL for the empty result as its set-first twin does.

Nineteen hand registrations of the same signatures, the scalar-first +, -, *
and || over a set, go with the change: the generator emits them, so the surface
they carry is unchanged while the named functions beside them are new. The
registered surface gains exactly those 19 names and loses none. setUnion of 5
and {1,3} answers {1, 3, 5}, setMinus of 5 and {1,3} answers {5},
setIntersection of 3 and {1,3} answers {3}, and setConcat of 'a' and {"b","c"}
answers {"ab", "ac"}.
@estebanzimanyi
estebanzimanyi merged commit c8a6ad2 into MobilityDB:main Aug 29, 2026
10 checks passed
@estebanzimanyi
estebanzimanyi deleted the duck/generate-set-algebra-reversed branch August 29, 2026 10:36
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