Add eachGreaterThan / eachLessThan / eachGreaterThanOrEqual / eachLessThanOrEqual operators - #46
Merged
Merged
Conversation
…rEqual operators Closes #24
…urning Establishes per-row predicates as a type-distinct family separate from single-value boolean expressions: - New operators: eachEqual (7 types), eachAnd, eachOr, eachNot - each* expressions now return booleanArrayReturning (was booleanReturning) - each* right operand accepts *Returning or *ArrayReturning, enabling per-row field-to-field comparisons without aggregates - where and joinItem.on broadened to accept booleanArrayReturning - having unchanged: structurally rejects per-row predicates, fixing accidental validation of non-aggregated fields in HAVING Sample migrations move field-to-literal filtering from arrayEquality (single-element array wrap) to eachEqual (unwrapped scalar). Three new samples cover field-to-field range comparison, the eachNot(eachEqual) not-equal idiom, and mixed-type eachAnd/eachOr composition. Version bump 0.1.0-preview.0.1.0 -> 0.1.0-preview.0.2.0. CHANGELOG entry includes detailed interpreter notes covering dispatch on the new oneOf slots and the each* polymorphism.
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.
Summary
definitions/comparisons:numericArrayComparison,stringArrayComparison,dateArrayComparison,datetimeArrayComparison,timeArrayComparison— each takes an*ArrayReturningleft operand and a matching single-value-returning right operand with the foureach*operators.definitions/comparison.oneOf, making the new operators available inwhere,having, andjoin.onwithout further changes.samples/13_range_filter.jsondemonstratingeachGreaterThanontotal(number) andeachLessThanoncreated_at(datetime) in the samewhereclause.README.md.Closes #24
Test plan
python3 -c "import json, jsonschema, glob; spec = json.load(open('PureQL-Specification.json')); [jsonschema.validate(json.load(open(f)), spec) for f in sorted(glob.glob('samples/*.json'))]")