fix(query): accept Bool, Date, and DateTime in min and max - #637
Merged
azimafroozeh merged 2 commits intoSep 5, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
5 tasks
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.
What & why
Closes #623.
min($p.birthdate)over aDatecolumn was refused at typecheck (T8: min requires numeric or string type, got Date?), andDateTimeandBoolcolumns the same way; only numeric andStringcolumns passed, and the executor had arms for those alone. Found converting Kuzu's aggregate tests to.gqtcases.T8rule formin/maxkeys on one predicate naming the accepted scalars (numeric,String,Bool,Date,DateTime) and its message lists them; lists, vectors, and Blob values stay refused.Boolean,Date32, andDate64arms through the existing typed min/max path (falsebeforetrue, dates chronological); the result keeps the column's own type, as before.Float64null is deleted: an all-aggregate query over zero matched rows now flows through grouping as one empty group, socountis 0 andmin/maxreturn a null of the column's own type;sumandavgstill buildFloat64.issue_623_min_max_over_date_and_bool.gqt: one accept step over all three column types, a zero-row step and a null-only-row step whose--- expect shapeblocks pin the result types through the schema check from test(gq): add a mandatory--- expect shapesection and a result-schema check #635, and four refusal steps (minover a list,maxover aVector,sumover aDate,minover aBlob).Backing issue / RFC
issue_623_min_max_over_date_and_bool.gqt)Checklist
.gqtcase, 7 steps: accept, zero rows, null-only row, four refusals; result types via--- expect shape; no Rust test, nothing the format cannot express)docs/user/queries/index.md: accepted types, ordering, zero-row shape;docs/releases/v0.11.0.md: Highlights bullet)Local verification
cargo test -p omnigraph-gqt— 116 unit + 12 cases green on50f3a6bc(the new case: 7 steps)cargo test -p omnigraph-compiler— 332 greencargo test -p omnigraph-engine --test aggregation— 8 greencargo clippy --workspace --all-targets— greencargo fmt --all --check— cleanpython3 scripts/check-docs.py— 126 files OKcargo test --workspace— run on the previous base9570c7a7: lib 403 passed / 1 failed (external_blob_file_policy_rejects_special_files, a known failure under the dev-machine sandbox), 45 integration binaries green; not rerun on50f3a6bcNotes for reviewers
min/maxcolumns are now typed as the column, notFloat64. A JSON row omits a null cell's key, so the difference shows only in the Arrow IPC result schema from feat: unify graph JSON output on one Arrow writer and offer Arrow IPC as a query result format #627.Boolinmin/maxfollows Kuzu, Neo4j, DuckDB, and Memgraph; PostgreSQL refuses it and offersbool_and/bool_orinstead.T8rule consults the accept set only for scalar arguments, somin($p)over a node variable still typechecks and orders the id string.''''''left by fix(compiler): refuse two projections that execute to one result column name #621 is removed.