fix: position predicates between span and value/span return BOOLEAN#14
Merged
nhungoc1508 merged 1 commit intomainfrom Apr 27, 2026
Merged
fix: position predicates between span and value/span return BOOLEAN#14nhungoc1508 merged 1 commit intomainfrom
nhungoc1508 merged 1 commit intomainfrom
Conversation
The 119 ScalarFunction registrations for position operators (<<, >>, &<, &>, -|-, <<#, #>>, &<#, #&>) and their span_left / span_right / span_overleft / span_overright / span_adjacent name forms in src/temporal/span.cpp declared a SpanType return (e.g. INTSPAN, TSTZSPAN). The SpanFunctions::Left_span_value / Right_span_value / Overleft_span_value / Overright_span_value / Adjacent_span_value implementations and their value-span / span-span variants already return bool from the underlying MEOS call (left_span_value etc.) — only the registrations were wrong. DuckDB enforces declared return types on the result vector, so these were unusable from SQL. Replaces the return-type slot with LogicalType::BOOLEAN across all five categories (left, right, overleft, overright, adjacent) and all variants (span_value, value_span, span_span). Smoke test: SELECT intspan '[3,5)' << 5; -- now returns boolean true SELECT 5 << intspan '[3,5)'; -- false SELECT floatspan '[3.5,5.5]' &< 5.5; -- true The position-predicates skip block in test/sql/parity/003_span.test (open in a separate PR) becomes activatable once both this fix and that parity port land.
This was referenced Apr 28, 2026
estebanzimanyi
added a commit
that referenced
this pull request
Apr 28, 2026
Five more parity files added in one commit. All five are
wholesale-skip manifests because the underlying surfaces are unbound
in MobilityDuck. The files stand as a tracked gap inventory for what
still needs to land on the temporal layer.
- 028_tbool_boolops.test
tbool boolean operators (& AND, | OR, ~ NOT) for value/tbool,
tbool/value, tbool/tbool combinations. MEOS symbols:
tand_*, tor_*, tnot_tbool.
- 029_ttext_textfuncs.test
ttext text functions and concatenation: lower / upper / initcap
on ttext, || for value/ttext, ttext/value, ttext/ttext. MEOS
symbols: ttext_lower, ttext_upper, ttext_initcap, *_concat.
DuckDB suggests `lower(textset)` when given ttext — the existing
text functions are set-only.
- 030_temporal_compops.test
Ever-/always- temporal comparison operators (?=, ?<>, ?<, ?<=,
?>, ?>= and #=, #<>, #<, #<=, #>, #>=). DuckDB's parser does
not accept ? or # as operator-name characters at all, so every
query fails before reaching MEOS. Either add equivalent
alphabetic functions (ever_eq, always_eq, ...) or extend the
DuckDB parser.
- 034_temporal_posops.test
Position operators between temporal types and tbox / tstzspan /
value (<<#, #>>, &<#, #&>, <<, >>, &<, &>, -|-) for any temporal
type. Same root-cause shape as the position-predicate fix landed
for spans (PR #14), one layer up. MEOS symbols: left_tnumber_*,
right_tnumber_*, overleft_tnumber_*, overright_tnumber_*,
before_tnumber_*, after_tnumber_*, overbefore_tnumber_*,
overafter_tnumber_*, adjacent_tnumber_*.
- 040_temporal_aggfuncs.test
Same architectural gap as PR #21 — tcount, tand, tor, tmin,
tmax, tsum, extent for temporal types, all needing the
AggregateFunction infrastructure that MobilityDuck doesn't have
anywhere yet.
Suite: 747 assertions across 18 test cases (5 new files, 0 new
active assertions).
nhungoc1508
pushed a commit
that referenced
this pull request
May 4, 2026
Five more parity files added in one commit. All five are
wholesale-skip manifests because the underlying surfaces are unbound
in MobilityDuck. The files stand as a tracked gap inventory for what
still needs to land on the temporal layer.
- 028_tbool_boolops.test
tbool boolean operators (& AND, | OR, ~ NOT) for value/tbool,
tbool/value, tbool/tbool combinations. MEOS symbols:
tand_*, tor_*, tnot_tbool.
- 029_ttext_textfuncs.test
ttext text functions and concatenation: lower / upper / initcap
on ttext, || for value/ttext, ttext/value, ttext/ttext. MEOS
symbols: ttext_lower, ttext_upper, ttext_initcap, *_concat.
DuckDB suggests `lower(textset)` when given ttext — the existing
text functions are set-only.
- 030_temporal_compops.test
Ever-/always- temporal comparison operators (?=, ?<>, ?<, ?<=,
?>, ?>= and #=, #<>, #<, #<=, #>, #>=). DuckDB's parser does
not accept ? or # as operator-name characters at all, so every
query fails before reaching MEOS. Either add equivalent
alphabetic functions (ever_eq, always_eq, ...) or extend the
DuckDB parser.
- 034_temporal_posops.test
Position operators between temporal types and tbox / tstzspan /
value (<<#, #>>, &<#, #&>, <<, >>, &<, &>, -|-) for any temporal
type. Same root-cause shape as the position-predicate fix landed
for spans (PR #14), one layer up. MEOS symbols: left_tnumber_*,
right_tnumber_*, overleft_tnumber_*, overright_tnumber_*,
before_tnumber_*, after_tnumber_*, overbefore_tnumber_*,
overafter_tnumber_*, adjacent_tnumber_*.
- 040_temporal_aggfuncs.test
Same architectural gap as PR #21 — tcount, tand, tor, tmin,
tmax, tsum, extent for temporal types, all needing the
AggregateFunction infrastructure that MobilityDuck doesn't have
anywhere yet.
Suite: 747 assertions across 18 test cases (5 new files, 0 new
active assertions).
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
The 119
ScalarFunctionregistrations for position operators (<<,>>,&<,&>,-|-,<<#,#>>,&<#,#&>) and theirspan_left/span_right/span_overleft/span_overright/span_adjacentname forms insrc/temporal/span.cppdeclared aSpanTypereturn (e.g.INTSPAN,TSTZSPAN). The implementations inSpanFunctions::Left_span_value/Right_span_value/Overleft_span_value/Overright_span_value/Adjacent_span_valueand their value-span / span-span variants already returnboolfrom the underlying MEOS call (left_span_valueetc.) — only the registrations were wrong. DuckDB enforces declared return types on the result vector, so these were unusable from SQL.Replaces the return-type slot with
LogicalType::BOOLEANacross all five categories (left, right, overleft, overright, adjacent) and all three variants (span_value,value_span,span_span).Smoke test
Test plan
make releasethenTZ=UTC ./build/release/test/unittest "<proj>/test/*"— full suite passes.The position-predicates skip block in
test/sql/parity/003_span.test(open in a separate PR) becomes activatable once both this fix and that parity port land.