Skip to content

Spatial join fails when running on top of colocated right outer join #12672

@mbasmanova

Description

@mbasmanova

The following query fails with "Reference has already been freed":

java.lang.IllegalStateException: Reference has already been freed
	at com.google.common.base.Preconditions.checkState(Preconditions.java:504)
	at com.facebook.presto.operator.ReferenceCount.release(ReferenceCount.java:55)
	at com.facebook.presto.operator.PagesSpatialIndexFactory.probeOperatorFinished(PagesSpatialIndexFactory.java:132)
	at com.facebook.presto.operator.SpatialJoinOperator.getOutput(SpatialJoinOperator.java:207)
	at com.facebook.presto.operator.Driver.processInternal(Driver.java:379)
WITH t AS (
  SELECT 
    l.* 
  FROM 
    tpch.tiny.lineitem l 
    RIGHT JOIN tpch.tiny.orders o ON l.linenumber = o.orderkey
) 
SELECT 
  * 
FROM 
  t, 
  tpch.tiny.lineitem u 
WHERE 
  ST_Distance(
    ST_Point(u.orderkey, u.linenumber), 
    ST_Point(t.orderkey, t.linenumber)
  ) < 1 

CC: @rschlussel

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions