AWS Athena st_centroid yields wrong result due to old Trino version

0

The query below on current AWS Athena version 3 gives a wrong result for the centroid, which lies way below the polygon (POINT (6.127790214246207 46.2084751184263)). The exact same query in PostGIS gives the correct POINT (6.1278266666666665 46.20875).

WITH poly AS (
    SELECT st_geometryfromtext('POLYGON ((
        6.12784 46.20880,
        6.12780 46.20873,
        6.12784 46.20872,
        6.12784 46.20880))') AS polygon
)
SELECT st_centroid(poly.polygon) as centroid_athena, poly.polygon
FROM poly

I also checked this for various Trino versions. The current Trino version 436 yields the correct result. Version 369 from roughly a year ago produces the same wrong output as AWS Athena.

When does AWS update the Trino version underlying Athena?

mcsoini
asked 3 months ago419 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions