prestodb/presto

ST_Centroid (Java) does not comply with ISO spec

Open

#26,947 建立於 2026年1月12日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)Java (15,558 star) (5,240 fork)batch import
buggood first issue

描述

In the ISO spec, ST_Centroid(empty_geometry) returns NULL, but in the Java code it returns an empty geometry. This is fixed for Velox/native in https://github.com/facebookincubator/velox/pull/15985 , but should also be fixed in Java.

Expected Behavior

ST_Centroid(ST_GeometryFromText('LINESTRING EMPTY')) IS NULL

Current Behavior

ST_IsEmpty(ST_Centroid(ST_GeometryFromText('LINESTRING EMPTY')))

Possible Solution

The ST_Centroid function should check for an empty input geometry and return null.

Steps to Reproduce

SELECT ST_Centroid(ST_GeometryFromText('LINESTRING EMPTY'))

貢獻者指南

ST_Centroid (Java) does not comply with ISO spec · prestodb/presto#26947 | Good First Issue