Skip to content

feat(query_engine): implement DateBetween::toArrowExpression - #1844

Open
fengelniederhammer wants to merge 1 commit into
1820-implement-intbetweentoarrowexpressionfrom
1821-implement-datebetweentoarrowexpression
Open

fengelniederhammer wants to merge 1 commit into
1820-implement-intbetweentoarrowexpressionfrom
1821-implement-datebetweentoarrowexpression

Conversation

@fengelniederhammer

Copy link
Copy Markdown
Contributor

resolves #1821

Summary

Allows to evaluate a date .between(...) operator on intermediate results (i.e. something that is not a table in the DB).

PR Checklist

  • All necessary documentation has been adapted or there is an issue to do so.
  • The implemented feature is covered by an appropriate test.

@github-actions

Copy link
Copy Markdown
Contributor

This is a preview of the changelog of the next release. If this branch is not up-to-date with the current main branch, the changelog may not be accurate. Rebase your branch on the main branch to get the most accurate changelog.

Note that this might contain changes that are on main, but not yet released.

Changelog:

0.17.6 (2026-11-18)

Features

  • query_engine: add type casts at query execution time (#1799) (f7acdf0)

Bug Fixes

  • query_engine: do not decompress every row before applying a limit (#1833) (d3c06a2)
  • query_engine: evaluate out-of-bound .at() expressions to null for null inputs (#1839) (511d2ee)
  • query_engine: limit the nesting of queries (#1828) (599d3a4)
  • query_engine: treat Unicode whitespace as whitespace and report non-ASCII errors (#1816) (edc1c02)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new tests cover only projections, leaving the FilterNode path for intermediate dates and null exclusion under negation untested for both plain and indexed dates.

1 open issue
What changed in this PR

Implements Arrow evaluation of date .between(...) expressions, enabling their use on intermediate query results rather than only database tables.

Changes:

  • Adds date-bound translation using Arrow Date32Scalar values.
  • Extracts shared inclusive-range translation and reuses it for integer expressions.
  • Adds projection tests for plain and indexed dates, including open bounds, inclusive endpoints, and null values.
File Description
src/​rhydb/​query_engine/​scalar_expressions/​int_between.cpp Delegates Arrow translation to the shared helper.
src/​rhydb/​query_engine/​scalar_expressions/​date_between.test.cpp Adds Arrow-backed date range scenarios.
src/​rhydb/​query_engine/​scalar_expressions/​date_between.h Declares the Arrow translation override.
src/​rhydb/​query_engine/​scalar_expressions/​date_between.cpp Converts date bounds to Arrow scalars and invokes the helper.
src/​rhydb/​query_engine/​scalar_expressions/​between_arrow.h Declares the shared range-expression helper.
src/​rhydb/​query_engine/​scalar_expressions/​between_arrow.cpp Implements inclusive comparisons and null-preserving unbounded behavior.

Review effort: Balanced

ARROW_PLAIN_DATE_BOUNDS_ARE_INCLUSIVE_SCENARIO,
ARROW_INDEXED_DATE_WITH_FROM_AND_TO_SCENARIO,
ARROW_INDEXED_DATE_WITH_FROM_SCENARIO,
ARROW_INDEXED_DATE_WITH_TO_SCENARIO
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.

Implement DateBetween::toArrowExpression

2 participants