Skip to content

Build the value set of a temporal with the set constructor of its base type - #117

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/value-set-builds-its-set
Sep 30, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/value-set-builds-its-set

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The value_set of TFloat, TText, TGeomPoint and TGeogPoint passes the array the MEOS
tfloat_values, ttext_values or tgeo_values returns, and its count, to floatset_make,
textset_make or geoset_make, and wraps the set in FloatSet, TextSet, GeometrySet or
GeographySet. The spatial ones round the set to their precision argument with set_round.

Witness. Each appended to a StringBuilder declared null, so each threw a
NullPointerException on any input. TText returned an anonymous Set whose inner was the
text array itself, and the spatial ones rebuilt their set from point text, which carries
no SRID.

Measured. Against the catalog and libmeos of MobilityDB 8a23781e4c with MEOS-API 8dddf59,
the testValueSet tests of TFloatTest, TTextTest, TGeomPointTest and TGeogPointTest read
{1.5, 2.5}, {"AAA", "BBB"}, SRID=3812;{"POINT(1.12 1)", "POINT(2 2)"} from a point at
1.123456 rounded to 2 digits, and SRID=4326;{"POINT(1 1)", "POINT(2 2)"}. The build succeeds
and the suites run 106 and 1,810 tests, all passing.

Why. MEOS builds a set from the values of its base type, and a set built that way holds
every value exactly, the SRID included.

…e type

The value_set of TFloat, TText, TGeomPoint and TGeogPoint passes the array the MEOS
tfloat_values, ttext_values or tgeo_values returns, and its count, to floatset_make,
textset_make or geoset_make, and wraps the set in FloatSet, TextSet, GeometrySet or
GeographySet. The spatial ones round the set to their precision argument with set_round.

Witness. Each appended to a StringBuilder declared null, so each threw a
NullPointerException on any input. TText returned an anonymous Set whose inner was the
text array itself, and the spatial ones rebuilt their set from point text, which carries
no SRID.

Measured. Against the catalog and libmeos of MobilityDB 8a23781e4c with MEOS-API 8dddf59,
the testValueSet tests of TFloatTest, TTextTest, TGeomPointTest and TGeogPointTest read
{1.5, 2.5}, {"AAA", "BBB"}, SRID=3812;{"POINT(1.12 1)", "POINT(2 2)"} from a point at
1.123456 rounded to 2 digits, and SRID=4326;{"POINT(1 1)", "POINT(2 2)"}. The build succeeds
and the suites run 106 and 1,810 tests, all passing.

Why. MEOS builds a set from the values of its base type, and a set built that way holds
every value exactly, the SRID included.
@estebanzimanyi
estebanzimanyi merged commit b80986c into MobilityDB:main Sep 30, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the fix/value-set-builds-its-set branch September 30, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant