feat(bindings): tbool boolean operators + ttext text functions (13 functions)#27
Merged
nhungoc1508 merged 1 commit intomainfrom Apr 27, 2026
Merged
Conversation
Adds 13 ScalarFunction registrations for two MobilityDB feature groups that were previously unbound in MobilityDuck: tbool boolean operators (7): - tbool & bool, bool & tbool, tbool & tbool - tbool | bool, bool | tbool, tbool | tbool - ~ tbool MEOS: tand_tbool_bool, tand_tbool_tbool, tor_tbool_bool, tor_tbool_tbool, tnot_tbool. ttext text functions (6): - lower(ttext), upper(ttext), initcap(ttext) - text || ttext, ttext || text, ttext || ttext MEOS: ttext_lower, ttext_upper, ttext_initcap, textcat_text_ttext, textcat_ttext_text, textcat_ttext_ttext. Implementation uses a small set of templated wrapper helpers (TemporalUnary, TemporalBinaryV, TemporalBinaryV1, TemporalBinaryTT, TextFromBlob) in src/temporal/temporal_functions.cpp to keep each ScalarFunction body to one or two lines. Pattern can be reused for the remaining tnumber arithmetic surface (PR #24 026 gap, ~96 registrations) once that work lands. Smoke test: SELECT TRUE & tbool 't@2000-01-01'; -> t@2000-01-01 00:00:00+00 SELECT tbool 't@...' & tbool 'f@...'; -> f@2000-01-01 00:00:00+00 SELECT TRUE | tbool 'f@...'; -> t@2000-01-01 00:00:00+00 SELECT ~ tbool 't@...'; -> f@2000-01-01 00:00:00+00 SELECT lower(ttext '"AAA"@...'); -> "aaa"@2000-01-01 00:00:00+00 SELECT upper(ttext '"hello"@...'); -> "HELLO"@2000-01-01 00:00:00+00 SELECT initcap(ttext '"hello world"@...'); -> "Hello World"@2000-01-01 00:00:00+00 SELECT text 'A' || ttext '"BB"@...'; -> "ABB"@2000-01-01 00:00:00+00 SELECT ttext '"AA"@...' || text 'X'; -> "AAX"@2000-01-01 00:00:00+00 SELECT ttext '"AA"@...' || ttext '"BB"@...'; -> "AABB"@2000-01-01 00:00:00+00 Full suite passes (747 assertions, 13 test cases).
This was referenced Apr 25, 2026
Member
Author
|
@nhungoc1508 — heads up, the same merge-target pattern from #8/#9 was about to re-occur: After this PR was squash-merged into main, PR #43's base was still pointing at this branch ( I've already proactively rebased the entire downstream binding stack onto main and updated PR #43's base to For future merges in this stack: when you merge a base PR into main, please update the next PR's base before merging: I'll keep monitoring and rebasing as PRs land — but flagging so you're aware. |
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
Adds 13 ScalarFunction registrations for two MobilityDB feature groups that were previously unbound in MobilityDuck.
tbool boolean operators (7)
tbool & BOOL,BOOL & tbool,tbool & tbooltand_tbool_bool,tand_tbool_tbool,BOOL~ tbooltnot_tboolttext text functions (6)
lower(ttext),upper(ttext),initcap(ttext)ttext_lower,ttext_upper,ttext_initcapImplementation
Adds five small templated wrapper helpers in
src/temporal/temporal_functions.cpp:TemporalToBlob/BlobToTemporal— round-trip theTemporal *blob between MEOS and DuckDB string vectorsTemporalUnary<Fn>— forf(Temporal*) -> Temporal*patternsTemporalBinaryV<T2, Fn>/TemporalBinaryV1<T1, Fn>— for value/temporal mixed-arg patternsTemporalBinaryTT<Fn>— forf(Temporal*, Temporal*) -> Temporal*TextFromBlob— forstring_t -> text *(PG-text format) conversionEach ScalarFunction body is now one or two lines. Same pattern can be reused for tnumber arithmetic (PR #24's
026gap, ~96 registrations).Smoke test
Test plan
make releasethenTZ=UTC ./build/release/test/unittest "<proj>/test/*"— full suite passes (747 assertions, 13 test cases).When this lands, PR #24's
028_tbool_boolops.testand029_ttext_textfuncs.testskip blocks both unwrap into ~10 active assertions each.