make Geometry comparable#25225
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Justin Dowdy.
|
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
f4ee92f to
1417e95
Compare
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
|
I've emailed the signed CLA. |
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
There was a problem hiding this comment.
I think this can be
private static final TypeOperatorDeclaration TYPE_OPERATOR_DECLARATION = extractOperatorDeclaration(GeometryType.class, lookup(), Slice.class);See UuidType for an example.
There was a problem hiding this comment.
I tried this but then the test failed:
[ERROR] Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 34.16 s <<< FAILURE! -- in io.trino.plugin.geospatial.TestGeoSp
atialQueries
[ERROR] io.trino.plugin.geospatial.TestGeoSpatialQueries.testDistinctGeometry -- Time elapsed: 9.717 s <<< ERROR!
io.trino.testing.QueryFailedException: io.trino.spi.TrinoException: Geometry READ_VALUE operator can not be adapted to convention (([FL
AT])FAIL_ON_NULL). Available implementations: [([BLOCK_POSITION_NOT_NULL])FAIL_ON_NULL, ([NEVER_NULL])BLOCK_BUILDER]
at io.trino.testing.AbstractTestingTrinoClient.execute(AbstractTestingTrinoClient.java:138)
at io.trino.testing.DistributedQueryRunner.executeInternal(DistributedQueryRunner.java:565)
at io.trino.testing.DistributedQueryRunner.execute(DistributedQueryRunner.java:548)
at io.trino.sql.query.QueryAssertions$QueryAssert.lambda$new$1(QueryAssertions.java:317)
at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:200)
at io.trino.sql.query.QueryAssertions$QueryAssert.result(QueryAssertions.java:436)
at io.trino.plugin.geospatial.TestGeoSpatialQueries.testDistinctGeometry(TestGeoSpatialQueries.java:58)
There was a problem hiding this comment.
This could implement isOrderable() = true as well.
There was a problem hiding this comment.
if you don't mind i'd like to do orderability in a follow on PR.
|
Can you add tests for this in |
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
1 similar comment
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
@electrum, done. before this change the test says: with this PR the test passes. |
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
1 similar comment
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
8035f44 to
aa71422
Compare
|
@electrum , looks like all checks have passed |
|
hey @wendigo , anything else i need to do for this PR? |
|
@justin2004 I wasn't involved in this review so I'd prefer to defer it to @electrum :) |
|
hey @electrum , anything else you'd like me to do for this PR? |
|
hey @wendigo , would you be willing to take this PR review over? |
There was a problem hiding this comment.
Ordering doesn't make sense for geometries.
martint
left a comment
There was a problem hiding this comment.
Thanks! I just have a couple of minor formatting-related comments.
Also, capitalize the commit message: "Make Geometry comparable"
There was a problem hiding this comment.
Move the arguments to the previous line.
There was a problem hiding this comment.
Capitalize the SQL keywords. Also, use VALUES instead of UNION ALL between two queries to synthesize the base data, and format it as follows for readability:
assertThat(query("""
SELECT DISTINCT ST_GeometryFromText(point)
FROM (VALUES 'POINT (-90 38.99)', 'POINT (-90 38.99)') t(point)
"""))
.result().matches(MaterializedResult.resultBuilder(getSession(), GEOMETRY)
.row("POINT (-90 38.99)")
.build());|
hey @martint , I made the changes as you requested! |
In PostGIS, instances of Geometry are comparable (that is, you can run
select distincton those columns).This PR allows Trino to do the same and addresses #24961.
e.g. with the patch applied:
EDIT:
I got the formatter to run (using intellij).
Release notes