Repository navigation
Generate the constructors of the temporal cell indexes - #496
Merged
estebanzimanyi merged 1 commit intoOct 24, 2026
Merged
estebanzimanyi merged 1 commit into
estebanzimanyi merged 1 commit into
Conversation
The constructors of tquadbin, th3index and ts2cell from a cell and a time value are generated from the catalog: the groups meos_quadbin_constructor, meos_h3_constructor and meos_s2cell_constructor are retired beside meos_temporal_constructor and the other family constructors. Each signature MobilityDB declares registers once, under its own name, argument types and result: tquadbin, th3index and ts2cell over their cell and a timestamptz (tquadbininst_make, th3indexinst_make, ts2cellinst_make), a tstzset and a tstzspan (the *seq_from_base_* functions) and a tstzspanset (the *seqset_from_base_tstzspanset functions). shape_sig_call reads a SQL span set argument as it reads a span: sig_call_arg takes its DuckDB type from SPANSET_TYPES beside the span, base and set types, which reaches the three span set forms and no other signature. The hand tquadbin(quadbin, timestamptz) of src/quadbin/tquadbin.cpp, the generated tquadbininst_make replacing it, is deleted with its executor Tquadbin_make and QuadbinTypes::RegisterScalarFunctions, which held nothing else; the quadbin and tquadbin types and their text casts stay, as for h3index and th3index. Measured: on main th3index(h3index, timestamptz), ts2cell(s2cell, timestamptz) and the span set forms of all three register nothing, hand or generated. The generator emits 12 registrations more, the four constructors of each of the three cell types, and changes no other line of src/generated; a second run reproduces it byte for byte. test/sql/tquadbin.test, th3index.test and ts2cell.test read each constructor against the literal of the answer MobilityDB's regression suite gives for the same call (352_tquadbin, 270_th3index, 603_ts2cell). The build has no warning in the lines this change writes, and the suite passes, 4908 assertions in 121 test cases.
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.
The constructors of tquadbin, th3index and ts2cell from a cell and a time value are generated from the catalog: the groups meos_quadbin_constructor, meos_h3_constructor and meos_s2cell_constructor are retired beside meos_temporal_constructor and the other family constructors. Each signature MobilityDB declares registers once, under its own name, argument types and result: tquadbin, th3index and ts2cell over their cell and a timestamptz (tquadbininst_make, th3indexinst_make, ts2cellinst_make), a tstzset and a tstzspan (the seq_from_base_ functions) and a tstzspanset (the *seqset_from_base_tstzspanset functions). shape_sig_call reads a SQL span set argument as it reads a span: sig_call_arg takes its DuckDB type from SPANSET_TYPES beside the span, base and set types, which reaches the three span set forms and no other signature.
The hand tquadbin(quadbin, timestamptz) of src/quadbin/tquadbin.cpp, the generated tquadbininst_make replacing it, is deleted with its executor Tquadbin_make and QuadbinTypes::RegisterScalarFunctions, which held nothing else; the quadbin and tquadbin types and their text casts stay, as for h3index and th3index.
Measured: on main th3index(h3index, timestamptz), ts2cell(s2cell, timestamptz) and the span set forms of all three register nothing, hand or generated. The generator emits 12 registrations more, the four constructors of each of the three cell types, and changes no other line of src/generated; a second run reproduces it byte for byte. test/sql/tquadbin.test, th3index.test and ts2cell.test read each constructor against the literal of the answer MobilityDB's regression suite gives for the same call (352_tquadbin, 270_th3index, 603_ts2cell). The build has no warning in the lines this change writes, and the suite passes, 4908 assertions in 121 test cases.