Skip to content

Mismatch between Presto Java and Presto C++ ST_EQUALS function #26253

@jkhaliqi

Description

@jkhaliqi

Your Environment

  • Presto version used:
  • Storage (HDFS/S3/GCS..):
  • Data source and connector used:
  • Deployment (Cloud or On-prem):
  • Pastebin link to the complete debug logs:

Expected Behavior

Not sure whether we want to return true(prestoC++) or false(Presto) when st_equals is called with empty geometries.
Documentation for both state : Returns true if the given geometries represent the same geometry.
presto docs: https://prestodb.io/docs/current/functions/geospatial.html#ST_Equals-Geometry-Geometry-boolean
velox docs: https://facebookincubator.github.io/velox/functions/presto/geospatial.html#ST_Equals

Current Behavior

Presto side:

Image

Presto C++ side:

Image Also looks like any empty would return true on prestoc++ so even comparing st_equals('polygon empty', 'linestring empty') from the tables also gives true where presto gives false.

Possible Solution

Assuming there is a mismatch with how the current libraries are dealing with empty cases. We can either check for empty cases and return true or false, depending on which is correct. Or throw an error when empty cases are inserted into ST_EQUALS for now.

Steps to Reproduce

  1. shown in screenshot of java case how to create table and run the query.

Context

Writing out end to end tests for ST_EQUALS comparing presto and prestoC++ and saw the mismatch.

Metadata

Metadata

Labels

Type

Projects

Status

🆕 Unprioritized

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions