presto-main/src/main/java/io/prestosql/sql/planner/LocalExecutionPlanner.java/Visitor/spatialTest
class Visitor:        private SpatialPredicate spatialTest(FunctionCall functionCall, boolean probeFirst, Optional<ComparisonExpression.Operator> comparisonOperator)
        {
            String functionName = ResolvedFunction.fromQualifiedName(functionCall.getName())
                    .map(ResolvedFunction::getSignature)
                    .map(Signature::getName)
                    .map(name -> name.toLowerCase(Locale.ENGLISH))
                    .orElse(functionCall.getName().toString());
            switch (functionName) {
                case ST_CONTAINS:
                    if (probeFirst) {
                        return (buildGeometry, probeGeometry, radius) -> probeGeometry.contains(buildGeometry);
                    }
                    return (buildGeometry, probeGeometry, radius) -> buildGeometry.contains(probeGeometry);
                case ST_WITHIN:
                    if (probeFirst) {
                        return (buildGeometry, probeGeometry, radius) -> probeGeometry.within(buildGeometry);
                    }
                    return (buildGeometry, probeGeometry, radius) -> buildGeometry.within(probeGeometry);
                case ST_INTERSECTS:
                    return (buildGeometry, probeGeometry, radius) -> buildGeometry.intersects(probeGeometry);
                case ST_DISTANCE:
                    if (comparisonOperator.get() == LESS_THAN) {
                        return (buildGeometry, probeGeometry, radius) -> buildGeometry.distance(probeGeometry) < radius.getAsDouble();
                    }
                    if (comparisonOperator.get() == LESS_THAN_OR_EQUAL) {
                        return (buildGeometry, probeGeometry, radius) -> buildGeometry.distance(probeGeometry) <= radius.getAsDouble();
                    }
                    throw new UnsupportedOperationException("Unsupported comparison operator: " + comparisonOperator.get());
                default:
                    throw new UnsupportedOperationException("Unsupported spatial function: " + functionName);
            }
        }