Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions geomesa-trino/geomesa-trino-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<dependency>
<groupId>org.locationtech.geomesa</groupId>
<artifactId>geomesa-z3_${scala.binary.version}</artifactId>
Expand Down Expand Up @@ -169,34 +165,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<sendJavaToScalac>false</sendJavaToScalac>
</configuration>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import io.trino.spi.type.RealType;
import io.trino.spi.type.RowType;
import io.trino.spi.type.VarcharType;
import org.locationtech.geomesa.curve.interop.SpaceFillingCurves.HexRange;
import org.locationtech.geomesa.trino.spatial.iceberg.transforms.SpatialIndexRanges;
import org.locationtech.geomesa.trino.spatial.iceberg.BboxHandles;
import org.locationtech.geomesa.trino.spatial.iceberg.GeoMesaColumnCatalog;
Expand Down Expand Up @@ -243,16 +244,16 @@ public Optional<ConstraintApplicationResult<ConnectorTableHandle>> applyFilter(
private static List<Range> buildPartitionRanges(SpatialPartitionHandle sp, List<Envelope> envelopes) {
List<Range> ranges = new ArrayList<>();
for (Envelope env : envelopes) {
List<String[]> hexRanges = switch (sp.kind()) {
List<HexRange> hexRanges = switch (sp.kind()) {
case Z2 -> SpatialIndexRanges.z2Ranges(env);
case XZ2 -> SpatialIndexRanges.xz2Ranges(env);
};
for (String[] r : hexRanges) {
if (r[0].equals(r[1])) {
ranges.add(Range.equal(VarcharType.VARCHAR, Slices.utf8Slice(r[0])));
for (HexRange r : hexRanges) {
if (r.lower().equals(r.upper())) {
ranges.add(Range.equal(VarcharType.VARCHAR, Slices.utf8Slice(r.lower())));
} else {
ranges.add(Range.range(VarcharType.VARCHAR,
Slices.utf8Slice(r[0]), true, Slices.utf8Slice(r[1]), true));
Slices.utf8Slice(r.lower()), true, Slices.utf8Slice(r.upper()), true));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@

package org.locationtech.geomesa.trino.spatial.iceberg.transforms;

import org.locationtech.geomesa.curve.interop.SpaceFillingCurves;
import org.locationtech.geomesa.curve.interop.SpaceFillingCurves.HexRange;
import org.locationtech.jts.geom.Envelope;

import java.util.Arrays;
import java.util.List;

/**
* Hex-encoded Z2/XZ2 index ranges covering a query envelope, for pushdown
* Hex-encoded Z2/XZ2 index ranges covering a JTS query envelope, for pushdown
* against hex-partitioned storage columns ({@code __<X>_z2__} /
* {@code __<X>_xz2__}).
*
* <p>Endpoints are encoded with {@code Z2SFC.hexEncode}/{@code XZ2SFC.hexEncode}
* (via {@link SfcBridge}), which left-align the significant bits so
* (via {@link SpaceFillingCurves}), which left-align the significant bits so
* lexicographic comparison over the fixed-width strings matches numeric
* comparison of the underlying index values. That makes the inclusive
* {@code [lo, hi]} string ranges directly usable both as VARCHAR domains on
* {@code [lo, hi]} ranges directly usable both as VARCHAR domains on
* the full column value and — because prefix order is preserved — under
* Iceberg {@code truncate(width)} partition projection at any width.
*/
Expand All @@ -41,26 +42,26 @@ public final class SpatialIndexRanges {
private SpatialIndexRanges() {}

/**
* Z2 index ranges covering the query envelope, hex-encoded for pushdown
* Z2 index ranges covering a JTS query envelope, hex-encoded for pushdown
* against a {@code __<X>_z2__} column.
*
* @param env query envelope in WGS84 lon/lat
* @return inclusive {@code [lo, hi]} hex ranges
* @return inclusive hex ranges
*/
public static List<String[]> z2Ranges(Envelope env) {
return Arrays.asList(SfcBridge.z2HexRanges(
env.getMinX(), env.getMinY(), env.getMaxX(), env.getMaxY(), MAX_RANGES));
public static List<HexRange> z2Ranges(Envelope env) {
return SpaceFillingCurves.z2HexRanges(
env.getMinX(), env.getMinY(), env.getMaxX(), env.getMaxY(), MAX_RANGES);
}

/**
* XZ2 index ranges covering the query envelope at {@link #G}, hex-encoded
* XZ2 index ranges covering a JTS query envelope at {@link #G}, hex-encoded
* for pushdown against a {@code __<X>_xz2__} column.
*
* @param env query envelope in WGS84 lon/lat
* @return inclusive {@code [lo, hi]} hex ranges
* @return inclusive hex ranges
*/
public static List<String[]> xz2Ranges(Envelope env) {
return Arrays.asList(SfcBridge.xz2HexRanges(
env.getMinX(), env.getMinY(), env.getMaxX(), env.getMaxY(), G, MAX_RANGES));
public static List<HexRange> xz2Ranges(Envelope env) {
return SpaceFillingCurves.xz2HexRanges(
env.getMinX(), env.getMinY(), env.getMaxX(), env.getMaxY(), G, MAX_RANGES);
}
}

This file was deleted.

Loading
Loading