Repository navigation
Document how query conditions treat null and omitted values (5.4) - #783
Merged
Merged
Conversation
Adds a Null and Omitted Values section to REST querying with verified examples, the =between=/gele/gelt/gtle/gtlt operators, a Resource API conditions note, a SQL NULL note, in-memory sort guidance, and a 5.4 release-note entry for harper PR #3925. Dispatch-Task: docs-harper-3925 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en null rules Dispatch-Task: docs-harper-3925 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…alytics conditions Dispatch-Task: docs-harper-3925 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dispatch-Task: docs-harper-3925 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-783 This preview will update automatically when you push new commits. |
…g note Dispatch-Task: docs-harper-3925 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-783 This preview will update automatically when you push new commits. |
🧹 Preview CleanupThe preview deployment for this PR has been removed. |
kriszyp
added a commit
to HarperFast/harper
that referenced
this pull request
Nov 5, 2026
…rperFast/documentation#783) * Document how query conditions treat null and omitted values (5.4) Adds a Null and Omitted Values section to REST querying with verified examples, the =between=/gele/gelt/gtle/gtlt operators, a Resource API conditions note, a SQL NULL note, in-memory sort guidance, and a 5.4 release-note entry for harper PR HarperFast/documentation#3925. Dispatch-Task: docs-harper-3925 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Scope the in-memory sort note to non-primary-key attributes and tighten null rules Dispatch-Task: docs-harper-3925 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Clarify range wording, scope the sort note and SQL claim, link get_analytics conditions Dispatch-Task: docs-harper-3925 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Point the SQL legacy-engine changes list at the NULL note Dispatch-Task: docs-harper-3925 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Use the standard plain-text version format in the schema null-indexing note Dispatch-Task: docs-harper-3925 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously deployed
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.
⊙ Problem
Match null and omitted values the same way whether a condition leads the scan or filters changes which records REST, Resource API and
search_by_conditionsconditions return for null and omitted values. The reference never said how conditions treat those values, and REST did not document=between=at all.🤔 Does the brief's "SQL is unchanged" hold?
Partly.
<>,NOT INandIS NULLare unchanged. A range compared withNULLdid change: it used to fail on a typed attribute, or returnNULLrows fromBETWEEN NULL AND x. Now it matches no rows. The SQL page and the release note say so.💡 Solution
=between=and itsgele,gelt,gtleandgtltforms.neruns in memory (except on the primary key), andlimitdoes not reduce that work.Behavior new in 5.4 has a v5.4.0 badge and, on each page that explains it, a pending-release note.
⚖️ Alternatives
betweensyntax.🤔 Publishing the range aliases
=gele=,=gelt=,=gtle=and=gtlt=become documented REST syntax. They already parse, and each was checked, including values equal to a bound. Documented syntax is hard to retire, so drop those rows if they should stay internal.🔧 Changes
reference/rest/querying.md— the=between=and range-alias operator rows, the Null Queries clarification that==nullmisses omitted attributes, the new Null and Omitted Values section with its rules and sample results, and the in-memory sort paragraph. Look hardest at the rules list: every other page links to it.reference/resources/resource-api.md— a null and omitted values subsection underconditionswith twosearch()examples, the indexed-sort bullet pointing at its exception, and thesortexception for conditions that cannot read the index.reference/resources/query-optimization.md— thenot_equalrow, the Unaligned sort bullet with the primary-key exception, and the v5.4.0 sort note.reference/operations-api/sql.md— a NULL and Omitted Values subsection, and a pointer to it from the legacy-engine changes list.reference/operations-api/operations.md— links fromsearch_by_conditionsandget_analytics.reference/database/schema.md— the null-indexing note says?category=nulldoes not match omitted attributes.release-notes/v5-lincoln/5.4.md— the release-note entry with upgrade impact.✅ Verification
b4fa7a988) and at its merge-base (81ddff7b5). A script asserted every published example on an indexed and an unindexed copy of the sample table, over REST,Table.search(),search_by_conditionsand SQL: 96/96 pass on the head. On the merge-base 43 fail, each showing documented old behavior.explain: trueshows in-memory sorting fornot_equalsorted on the same attribute, and none for the primary key or a range.npm run build,format:check,lint,typecheckandtest:examplespass.What the merge-base returned instead
discount=ne=5: 2, 5 (null and omitted dropped); the same throughsearch()andsearch_by_conditions.ge=null,between=(null,10),gele/geltwith a null lower bound: also returned the storednull(record 3), indexed and unindexed.tags=ne=sale: indexed 2 only; unindexed 2, 3, 4, 5, 6 (whole-array comparison). Unindexedtags=ne=nullincluded[].discount=ne=5&sort(discount)and an unindexedu=lt=3&sort(u): primary-key order.discount >= NULLandBETWEEN NULL AND 10failed withInvalid value for attribute discount. On an untyped attribute,BETWEEN NULL AND 3returned theNULLrow.Refs HarperFast/harper#3925
Depends-on: HarperFast/harper#3925
PR QA: skipped @ d4c017a — HarperFast/documentation PR; PR-time QA covers harper and harper-pro
🤖 Generated by Claude Opus 5.5 (Claude Code); posted via @kriszyp.
Release target: v5.4 — documents harper PR #3925, which is milestoned v5.4
Related PRs: #784 overlaps (edits the same search_by_conditions line in operations.md and inserts at the same point after
conditionsin resource-api.md), #779 overlaps (adjacent edits to the resource-api.md sort section and the 5.4 release notes), 3 others independentComplexity: medium
Origin — the dispatch brief this PR was written from
Document how query conditions treat null and omitted values (harper v5.4)
Document how REST and Resource-API query conditions treat null and omitted attribute values, after Match null and omitted values the same way whether a condition leads the scan or filters (harper v5.4).
What changed (applies whichever condition leads, indexed or not):
newith a non-null value (?b=ne=5) matches rows where the attribute is null or omitted. Before, an indexednethat was the only condition (or led the query) dropped those rows.lt,le,gt,ge,betweenand itsgele/gelt/gtlt/gtlevariants) ever matches a null or omitted value. Anulllower bound means "no lower bound":?b=between=(null,3)returns the same rows as?b=le=3, and?b=ge=nullreturns every row with a non-nullb. Before,ge=nullandbetween=(null,x)also returned null rows.ne vmatches a row when some element is notv; a row whose only elements equalv(['x'],['x','x']) does not match, an empty array does not matchne null, and a null or omitted array matchesne v.ne) now returns rows in sort order. Before, such results came back in primary-key order.<>andNOT INexclude NULL,IS NULLmatches null and omitted, and a range compared with a NULL literal matches no rows.Where: the REST querying reference (comparison operators,
ne,between, null values, sorting) and the Resource APIsearchconditions reference. Add a short "null and missing values" note with the rules above and one or two examples; keep it in the v5.4 docs, with a release-note line for the changedne, null-bound range and arraynebehavior.Verify every example against a v5.4 build (or the PR branch) before publishing.
Dispatch: task
docs-harper-3925· queued by task:harper-3731-null-omitted-scan-filter-parity · ran by claude/opus/xhigh · worker kzyp-xps-1Ready-For-Promotion: d4c017a urgency=normal late=none
Review-Coverage: authored=claude; ran=gemini,cursor-composer,codex; adjudicated=domain; declined=cursor-grok,muse; rounds=5; full=1 @ d4c017a
Review-Attention: skim ~1m @ d4c017a