Skip to content
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

Add Row2.contains(Row2) #16649

Open
lukaseder opened this issue May 6, 2024 · 1 comment
Open

Add Row2.contains(Row2) #16649

lukaseder opened this issue May 6, 2024 · 1 comment

Comments

@lukaseder
Copy link
Member

A predicate similar to our existing Row2.overlaps(Row2) predicate is Row2.contains(Row2), where a row is considered a range of values, e.g.:

(1, 5) CONTAINS (2, 4) = TRUE
(1, 4) CONTAINS (2, 5) = FALSE

The implementation would look like this:

(a, b) CONTAINS (x, y)
x BETWEEN a AND b AND y BETWEEN a AND b

For the record:

(a, b) OVERLAPS (x, y)
x <= b AND y <= y
@lukaseder
Copy link
Member Author

lukaseder commented May 6, 2024

Row2 is historically special, because the SQL standard defines an OVERLAPS predicate on it. But I kinda feel that we shouldn't continue "abusing" Row2 for this purpose, but rather, introduce a new Range<T> type (possibly extending Row2<T, T>), which makes these things a bit more specific.

In PostgreSQL, this type could map to native RANGE types, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant