This is an automated email from the ASF dual-hosted git repository.
jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sedona.git
The following commit(s) were added to refs/heads/master by this push:
new 83bd94a780 [GH-2744] Clean up Maven build logs (#2801)
83bd94a780 is described below
commit 83bd94a780bbe9cfd8e06e08dd3ec4ad1a673b3f
Author: Jia Yu <[email protected]>
AuthorDate: Mon Mar 30 09:17:16 2026 -0700
[GH-2744] Clean up Maven build logs (#2801)
---
.../common/FunctionsProj4PerformanceTest.java | 42 ++++++++++++----------
.../org/apache/sedona/common/FunctionsTest.java | 5 ++-
.../sedona/common/S2Geography/TestHelper.java | 8 +++--
.../geometrySerde/SpatialIndexSerdeTest.java | 24 +++++++------
common/src/test/resources/log4j2.properties | 2 +-
.../java/org/apache/sedona/flink/FunctionTest.java | 5 ++-
flink/src/test/resources/log4j2.properties | 2 +-
.../formatMapper/shapefileParser/ShapefileRDD.java | 6 +++-
.../showcase/EarthdataMapperRunnableExample.java | 5 +--
.../org/apache/sedona/core/showcase/Example.java | 7 ++--
.../sedona/viz/core/ImageSerializableWrapper.java | 2 +-
.../visualizationEffect/ChoroplethMap.java | 2 +-
.../org/apache/sedona/viz/showcase/Example.java | 7 ++--
.../ScalaEarthdataMapperRunnableExample.scala | 2 +-
.../apache/sedona/core/showcase/ScalaExample.scala | 2 +-
.../sedona/stats/autocorrelation/Moran.scala | 1 -
.../apache/sedona/viz/showcase/ScalaExample.scala | 6 ++--
.../geoparquet/GeoParquetMetaData.scala | 14 ++++----
.../strategy/join/BroadcastIndexJoinExec.scala | 3 ++
.../strategy/join/JoinQueryDetector.scala | 8 +++++
.../quadtree/RenderQuadTree.java | 6 +++-
.../org/apache/sedona/viz/NYCTripPointMapper.java | 6 +++-
spark/common/src/test/resources/log4j2.properties | 2 +-
.../spark-3.4/src/test/resources/log4j2.properties | 2 +-
.../spark-3.5/src/test/resources/log4j2.properties | 2 +-
.../spark-4.0/src/test/resources/log4j2.properties | 2 +-
.../spark-4.1/src/test/resources/log4j2.properties | 2 +-
27 files changed, 108 insertions(+), 67 deletions(-)
diff --git
a/common/src/test/java/org/apache/sedona/common/FunctionsProj4PerformanceTest.java
b/common/src/test/java/org/apache/sedona/common/FunctionsProj4PerformanceTest.java
index c9c3951fa4..1f14ccd5d3 100644
---
a/common/src/test/java/org/apache/sedona/common/FunctionsProj4PerformanceTest.java
+++
b/common/src/test/java/org/apache/sedona/common/FunctionsProj4PerformanceTest.java
@@ -31,6 +31,8 @@ import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Point;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Performance tests for Proj4sedona CRS transformation.
@@ -52,6 +54,7 @@ import org.locationtech.jts.geom.Point;
*/
public class FunctionsProj4PerformanceTest extends TestBase {
+ private static final Logger log =
LoggerFactory.getLogger(FunctionsProj4PerformanceTest.class);
private static final GeometryFactory GEOMETRY_FACTORY = new
GeometryFactory();
private static final int WARM_ITERATIONS = 10;
@@ -70,19 +73,19 @@ public class FunctionsProj4PerformanceTest extends TestBase
{
}
private void printHeader(String title) {
- System.out.println();
- System.out.println("=".repeat(70));
- System.out.println(title);
- System.out.println("=".repeat(70));
+ log.info("");
+ log.info("=".repeat(70));
+ log.info(title);
+ log.info("=".repeat(70));
}
private void printResult(String label, double coldMs, double warmAvgUs, int
cacheEntries) {
double speedup = (coldMs * 1000) / warmAvgUs;
- System.out.printf("Cold (1 call): %10.2f ms%n", coldMs);
- System.out.printf("Warm (%d calls): %10.2f μs avg%n", WARM_ITERATIONS,
warmAvgUs);
- System.out.printf("Cache speedup: %10.0fx%n", speedup);
+ log.info(String.format("Cold (1 call): %10.2f ms", coldMs));
+ log.info(String.format("Warm (%d calls): %10.2f μs avg",
WARM_ITERATIONS, warmAvgUs));
+ log.info(String.format("Cache speedup: %10.0fx", speedup));
if (cacheEntries >= 0) {
- System.out.printf("Proj cache entries: %10d%n", cacheEntries);
+ log.info(String.format("Proj cache entries: %10d", cacheEntries));
}
}
@@ -95,7 +98,7 @@ public class FunctionsProj4PerformanceTest extends TestBase {
Point point = createTestPoint(SF_LON, SF_LAT);
// ===== Proj4sedona =====
- System.out.println("\nProj4sedona:");
+ log.info("\nProj4sedona:");
Proj4.clearCache();
// Cold call
@@ -116,7 +119,7 @@ public class FunctionsProj4PerformanceTest extends TestBase
{
assertEquals(3857, proj4ColdResult.getSRID());
// ===== GeoTools =====
- System.out.println("\nGeoTools:");
+ log.info("\nGeoTools:");
// Cold call
coldStart = System.nanoTime();
@@ -136,8 +139,9 @@ public class FunctionsProj4PerformanceTest extends TestBase
{
// ===== Comparison =====
double warmSpeedup = gtWarmAvgUs / proj4WarmAvgUs;
- System.out.printf(
- "%nComparison: Proj4sedona is %.1fx faster than GeoTools (warm)%n",
warmSpeedup);
+ log.info(
+ String.format(
+ "%nComparison: Proj4sedona is %.1fx faster than GeoTools (warm)",
warmSpeedup));
// Verify both produce similar results
assertEquals(
@@ -202,11 +206,11 @@ public class FunctionsProj4PerformanceTest extends
TestBase {
double warmAvgUs = (warmTotalMs * 1000) / WARM_ITERATIONS;
printResult("Remote Fetch EPSG", coldMs, warmAvgUs,
Proj4.getCacheSize());
- System.out.printf("Note: Cold time includes network fetch from
spatialreference.org%n");
+ log.info("Note: Cold time includes network fetch from
spatialreference.org");
assertNotNull(coldResult);
assertEquals(2154, coldResult.getSRID());
} catch (Exception e) {
- System.out.println("Skipped: Network fetch failed - " + e.getMessage());
+ log.info("Skipped: Network fetch failed - {}", e.getMessage());
// Don't fail the test if network is unavailable
}
}
@@ -304,8 +308,8 @@ public class FunctionsProj4PerformanceTest extends TestBase
{
double warmAvgUs = (warmTotalMs * 1000) / WARM_ITERATIONS;
printResult("Grid File (local)", coldMs, warmAvgUs, Proj4.getCacheSize());
- System.out.printf("Grid cache entries: %10d%n", NadgridRegistry.size());
- System.out.printf("Note: Cold time includes loading grid file from
disk%n");
+ log.info(String.format("Grid cache entries: %10d",
NadgridRegistry.size()));
+ log.info("Note: Cold time includes loading grid file from disk");
assertNotNull(coldResult);
assertTrue(NadgridRegistry.size() > 0);
}
@@ -337,12 +341,12 @@ public class FunctionsProj4PerformanceTest extends
TestBase {
double warmAvgUs = (warmTotalMs * 1000) / WARM_ITERATIONS;
printResult("Grid File (remote)", coldMs, warmAvgUs,
Proj4.getCacheSize());
- System.out.printf("Grid cache entries: %10d%n",
NadgridRegistry.size());
- System.out.printf("Note: Cold time includes downloading grid file
(~15MB)%n");
+ log.info(String.format("Grid cache entries: %10d",
NadgridRegistry.size()));
+ log.info("Note: Cold time includes downloading grid file (~15MB)");
assertNotNull(coldResult);
assertTrue(NadgridRegistry.size() > 0);
} catch (Exception e) {
- System.out.println("Skipped: Remote grid download failed - " +
e.getMessage());
+ log.info("Skipped: Remote grid download failed - {}", e.getMessage());
// Don't fail the test if network is unavailable
}
}
diff --git a/common/src/test/java/org/apache/sedona/common/FunctionsTest.java
b/common/src/test/java/org/apache/sedona/common/FunctionsTest.java
index 882a18de82..455ea784c0 100644
--- a/common/src/test/java/org/apache/sedona/common/FunctionsTest.java
+++ b/common/src/test/java/org/apache/sedona/common/FunctionsTest.java
@@ -41,8 +41,11 @@ import
org.locationtech.jts.geom.prep.PreparedGeometryFactory;
import org.locationtech.jts.io.ParseException;
import org.locationtech.jts.io.WKTReader;
import org.locationtech.jts.io.WKTWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class FunctionsTest extends TestBase {
+ private static final Logger log =
LoggerFactory.getLogger(FunctionsTest.class);
public static final GeometryFactory GEOMETRY_FACTORY = new GeometryFactory();
protected static final double FP_TOLERANCE = 1e-12;
@@ -376,7 +379,7 @@ public class FunctionsTest extends TestBase {
PreparedGeometryFactory factory = new PreparedGeometryFactory();
PreparedGeometry prepLineString = factory.create(lineString);
boolean intersects = prepLineString.intersects(point);
- System.out.println(intersects);
+ log.debug("intersects: {}", intersects);
}
@Test
diff --git
a/common/src/test/java/org/apache/sedona/common/S2Geography/TestHelper.java
b/common/src/test/java/org/apache/sedona/common/S2Geography/TestHelper.java
index dee589ab9d..13768978ab 100644
--- a/common/src/test/java/org/apache/sedona/common/S2Geography/TestHelper.java
+++ b/common/src/test/java/org/apache/sedona/common/S2Geography/TestHelper.java
@@ -29,9 +29,13 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
import org.locationtech.jts.io.ParseException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class TestHelper {
+ private static final Logger log = LoggerFactory.getLogger(TestHelper.class);
+
private static final double EPS = 1e-6;
public static void assertRoundTrip(Geography original, EncodeOptions opts)
throws IOException {
@@ -172,8 +176,8 @@ public class TestHelper {
boolean isEqual = compareTo(geoWKT, geoWKT) == 0;
if (!isEqual) {
- System.out.println(geoWKB);
- System.out.println(geoWKT);
+ log.debug("geoWKB: {}", geoWKB);
+ log.debug("geoWKT: {}", geoWKT);
}
assertTrue(isEqual);
}
diff --git
a/common/src/test/java/org/apache/sedona/common/geometrySerde/SpatialIndexSerdeTest.java
b/common/src/test/java/org/apache/sedona/common/geometrySerde/SpatialIndexSerdeTest.java
index 8e0bd2534d..fad833e43c 100644
---
a/common/src/test/java/org/apache/sedona/common/geometrySerde/SpatialIndexSerdeTest.java
+++
b/common/src/test/java/org/apache/sedona/common/geometrySerde/SpatialIndexSerdeTest.java
@@ -41,9 +41,13 @@ import org.locationtech.jts.geom.Point;
import org.locationtech.jts.index.SpatialIndex;
import org.locationtech.jts.index.quadtree.Quadtree;
import org.locationtech.jts.index.strtree.STRtree;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class SpatialIndexSerdeTest {
+ private static final Logger log =
LoggerFactory.getLogger(SpatialIndexSerdeTest.class);
+
private final Kryo kryo = new Kryo();
private final GeometryFactory geometryFactory = new GeometryFactory();
@@ -76,7 +80,7 @@ public class SpatialIndexSerdeTest {
// get expect result
SpatialIndex dtree = deserializeIndexKryo(serializeIndexKryo(tree));
- System.out.println("\n==== test correctness of " + aClass.toString() +
"====");
+ log.info("==== test correctness of {} ====", aClass);
// test query all object
assertThat(queryIndex(tree, null), is(queryIndex(dtree, null)));
@@ -105,14 +109,14 @@ public class SpatialIndexSerdeTest {
}
byte[] withSerde = serializeIndexKryo(tree);
- System.out.println("\n==== test size of " + aClass.toString() + "====");
- System.out.println("original size : " + noSerde.length);
- System.out.println("with serde kryo size : " + withSerde.length);
- System.out.println("percent : " + (double) withSerde.length / (double)
noSerde.length);
+ log.info("==== test size of {} ====", aClass);
+ log.info("original size : {}", noSerde.length);
+ log.info("with serde kryo size : {}", withSerde.length);
+ log.info("percent : {}", (double) withSerde.length / (double)
noSerde.length);
}
public void compareTime(Class aClass) throws Exception {
- System.out.println("\n==== test Serialize time of " + aClass.toString() +
"====");
+ log.info("==== test Serialize time of {} ====", aClass);
final int indexSize = 1000000;
SpatialIndex tree = generateIndex(indexSize, aClass);
double before, after;
@@ -121,12 +125,12 @@ public class SpatialIndexSerdeTest {
before = System.currentTimeMillis();
byte[] noSerde = serializeIndexNoKryo(tree);
after = System.currentTimeMillis();
- System.out.println("originalserialize time : " + (after - before) / 1000);
+ log.info("original serialize time : {}", (after - before) / 1000);
before = System.currentTimeMillis();
deserializeIndexNoKryo(noSerde);
after = System.currentTimeMillis();
- System.out.println("original deserialize time : " + (after - before) /
1000);
+ log.info("original deserialize time : {}", (after - before) / 1000);
// do with serde
if (aClass == Quadtree.class) {
kryo.register(Quadtree.class, new SpatialIndexSerde());
@@ -137,12 +141,12 @@ public class SpatialIndexSerdeTest {
before = System.currentTimeMillis();
byte[] withSerde = serializeIndexKryo(tree);
after = System.currentTimeMillis();
- System.out.println("with serde kryo serialize time : " + (after - before)
/ 1000);
+ log.info("with serde kryo serialize time : {}", (after - before) / 1000);
before = System.currentTimeMillis();
deserializeIndexKryo(withSerde);
after = System.currentTimeMillis();
- System.out.println("with serde kryo deserialize time : " + (after -
before) / 1000);
+ log.info("with serde kryo deserialize time : {}", (after - before) / 1000);
}
private byte[] serializeIndexNoKryo(SpatialIndex index) throws IOException {
diff --git a/common/src/test/resources/log4j2.properties
b/common/src/test/resources/log4j2.properties
index 706796ef13..ac8a7f7052 100644
--- a/common/src/test/resources/log4j2.properties
+++ b/common/src/test/resources/log4j2.properties
@@ -16,7 +16,7 @@
# under the License.
# Set everything to be logged to the file target/unit-tests.log
-rootLogger.level = info
+rootLogger.level = warn
rootLogger.appenderRef.file.ref = File
appender.file.type = File
diff --git a/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java
b/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java
index a348c074d7..078ad9baf5 100644
--- a/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java
+++ b/flink/src/test/java/org/apache/sedona/flink/FunctionTest.java
@@ -40,8 +40,11 @@ import org.junit.Test;
import org.locationtech.jts.geom.*;
import org.locationtech.jts.io.ParseException;
import org.locationtech.jts.operation.buffer.BufferParameters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class FunctionTest extends TestBase {
+ private static final Logger log =
LoggerFactory.getLogger(FunctionTest.class);
@BeforeClass
public static void onceExecutedBeforeAll() {
@@ -2800,7 +2803,7 @@ public class FunctionTest extends TestBase {
Table bowTieTable = tableEnv.sqlQuery("SELECT ST_GeomFromText('" +
bowTieWKT + "') AS geom");
Table bowTieValidityTable = bowTieTable.select(call("ST_IsValidReason",
$("geom")));
String bowTieValidityReason = (String)
first(bowTieValidityTable).getField(0);
- System.out.println(bowTieValidityReason);
+ log.debug("bowTieValidityReason: {}", bowTieValidityReason);
assertTrue(bowTieValidityReason.contains("Self-intersection"));
// Test with a valid geometry (simple linestring)
diff --git a/flink/src/test/resources/log4j2.properties
b/flink/src/test/resources/log4j2.properties
index 706796ef13..ac8a7f7052 100644
--- a/flink/src/test/resources/log4j2.properties
+++ b/flink/src/test/resources/log4j2.properties
@@ -16,7 +16,7 @@
# under the License.
# Set everything to be logged to the file target/unit-tests.log
-rootLogger.level = info
+rootLogger.level = warn
rootLogger.appenderRef.file.ref = File
appender.file.type = File
diff --git
a/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/ShapefileRDD.java
b/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/ShapefileRDD.java
index 8d94e9d551..bbcd9644be 100644
---
a/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/ShapefileRDD.java
+++
b/spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/ShapefileRDD.java
@@ -44,6 +44,8 @@ import org.locationtech.jts.geom.MultiPoint;
import org.locationtech.jts.geom.MultiPolygon;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.geom.Polygon;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import scala.Tuple2;
// TODO: Auto-generated Javadoc
@@ -52,6 +54,8 @@ import scala.Tuple2;
@Deprecated
public class ShapefileRDD implements Serializable {
+ private static final Logger log =
LoggerFactory.getLogger(ShapefileRDD.class);
+
/** The geometry factory. */
public static GeometryFactory geometryFactory = new GeometryFactory();
/** The Constant PrimitiveToShape. */
@@ -75,7 +79,7 @@ public class ShapefileRDD implements Serializable {
private final VoidFunction<Geometry> PrintShape =
new VoidFunction<Geometry>() {
public void call(Geometry shape) throws Exception {
- System.out.println(shape.toText());
+ log.debug("{}", shape.toText());
}
};
/** shape collection. */
diff --git
a/spark/common/src/main/java/org/apache/sedona/core/showcase/EarthdataMapperRunnableExample.java
b/spark/common/src/main/java/org/apache/sedona/core/showcase/EarthdataMapperRunnableExample.java
index 0859db52bc..8311232c3e 100644
---
a/spark/common/src/main/java/org/apache/sedona/core/showcase/EarthdataMapperRunnableExample.java
+++
b/spark/common/src/main/java/org/apache/sedona/core/showcase/EarthdataMapperRunnableExample.java
@@ -31,12 +31,13 @@ import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.serializer.KryoSerializer;
import org.apache.spark.storage.StorageLevel;
import org.locationtech.jts.geom.Envelope;
-
// TODO: Auto-generated Javadoc
/** The Class EarthdataMapperRunnableExample. */
public class EarthdataMapperRunnableExample {
+ private static final Logger log =
Logger.getLogger(EarthdataMapperRunnableExample.class);
+
/** The sc. */
public static JavaSparkContext sc;
@@ -103,7 +104,7 @@ public class EarthdataMapperRunnableExample {
testSpatialRangeQuery();
testSpatialRangeQueryUsingIndex();
sc.stop();
- System.out.println("All Earthdata DEMOs passed!");
+ log.info("All Earthdata DEMOs passed!");
}
/** Test spatial range query. */
diff --git
a/spark/common/src/main/java/org/apache/sedona/core/showcase/Example.java
b/spark/common/src/main/java/org/apache/sedona/core/showcase/Example.java
index 0ca6e925de..93833efc5a 100644
--- a/spark/common/src/main/java/org/apache/sedona/core/showcase/Example.java
+++ b/spark/common/src/main/java/org/apache/sedona/core/showcase/Example.java
@@ -42,12 +42,13 @@ import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Envelope;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Point;
-
// TODO: Auto-generated Javadoc
/** The Class Example. */
public class Example implements Serializable {
+ private static final Logger log = Logger.getLogger(Example.class);
+
/** The sc. */
public static JavaSparkContext sc;
@@ -152,11 +153,11 @@ public class Example implements Serializable {
testLoadShapefileIntoPolygonRDD();
} catch (Exception e) {
e.printStackTrace();
- System.out.println("DEMOs failed!");
+ log.error("DEMOs failed!");
return;
}
sc.stop();
- System.out.println("All DEMOs passed!");
+ log.info("All DEMOs passed!");
}
/**
diff --git
a/spark/common/src/main/java/org/apache/sedona/viz/core/ImageSerializableWrapper.java
b/spark/common/src/main/java/org/apache/sedona/viz/core/ImageSerializableWrapper.java
index 139efabab8..b5747eb811 100644
---
a/spark/common/src/main/java/org/apache/sedona/viz/core/ImageSerializableWrapper.java
+++
b/spark/common/src/main/java/org/apache/sedona/viz/core/ImageSerializableWrapper.java
@@ -69,7 +69,7 @@ public class ImageSerializableWrapper implements Serializable
{
in.defaultReadObject();
image = ImageIO.read(in);
if (image == null) {
- System.out.println("I got nothing from the stream!");
+ log.warn("I got nothing from the stream!");
}
}
diff --git
a/spark/common/src/main/java/org/apache/sedona/viz/extension/visualizationEffect/ChoroplethMap.java
b/spark/common/src/main/java/org/apache/sedona/viz/extension/visualizationEffect/ChoroplethMap.java
index dd6dd93d6c..d0053ae1ff 100644
---
a/spark/common/src/main/java/org/apache/sedona/viz/extension/visualizationEffect/ChoroplethMap.java
+++
b/spark/common/src/main/java/org/apache/sedona/viz/extension/visualizationEffect/ChoroplethMap.java
@@ -163,7 +163,7 @@ public class ChoroplethMap extends VisualizationOperator {
logger.debug("[VisualizationOperator][GenerateColorMatrix][Start]");
final long maxWeight = this.distributedCountMatrix.max(new
PixelCountComparator())._2;
final long minWeight = 0;
- System.out.println("Max weight "+maxWeight);
+ logger.debug("Max weight " + maxWeight);
JavaPairRDD<Integer, Long> normalizedPixelWeights =
this.distributedCountMatrix.mapToPair(new PairFunction<Tuple2<Integer,Long>,
Integer, Long>(){
@Override
public Tuple2<Integer, Long> call(Tuple2<Integer, Long> pixelWeight)
throws Exception {
diff --git
a/spark/common/src/main/java/org/apache/sedona/viz/showcase/Example.java
b/spark/common/src/main/java/org/apache/sedona/viz/showcase/Example.java
index 994dbd787a..29900b394a 100644
--- a/spark/common/src/main/java/org/apache/sedona/viz/showcase/Example.java
+++ b/spark/common/src/main/java/org/apache/sedona/viz/showcase/Example.java
@@ -46,12 +46,13 @@ import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.locationtech.jts.geom.Envelope;
import org.locationtech.jts.geom.Polygon;
-
// TODO: Auto-generated Javadoc
/** The Class Example. */
public class Example {
+ private static final Logger log = Logger.getLogger(Example.class);
+
/** The spark context. */
static JavaSparkContext sparkContext;
@@ -445,9 +446,9 @@ public class Example {
&& parallelFilterRenderStitch(parallelFilterRenderStitchOutputPath +
"-stitched")
&& parallelFilterRenderNoStitch(parallelFilterRenderStitchOutputPath)
&& earthdataVisualization(earthdataScatterPlotOutputPath)) {
- System.out.println("All 5 Demos have passed.");
+ log.info("All 5 Demos have passed.");
} else {
- System.out.println("Demos failed.");
+ log.info("Demos failed.");
}
sparkContext.stop();
}
diff --git
a/spark/common/src/main/scala/org/apache/sedona/core/showcase/ScalaEarthdataMapperRunnableExample.scala
b/spark/common/src/main/scala/org/apache/sedona/core/showcase/ScalaEarthdataMapperRunnableExample.scala
index 0d91b8c647..e621cc5bd2 100644
---
a/spark/common/src/main/scala/org/apache/sedona/core/showcase/ScalaEarthdataMapperRunnableExample.scala
+++
b/spark/common/src/main/scala/org/apache/sedona/core/showcase/ScalaEarthdataMapperRunnableExample.scala
@@ -47,7 +47,7 @@ object ScalaEarthdataMapperRunnableExample extends App {
testSpatialRangeQuery()
testSpatialRangeQueryUsingIndex()
sc.stop()
- System.out.println("All Earthdata DEMOs passed!")
+ println("All Earthdata DEMOs passed!")
/**
* Test spatial range query.
diff --git
a/spark/common/src/main/scala/org/apache/sedona/core/showcase/ScalaExample.scala
b/spark/common/src/main/scala/org/apache/sedona/core/showcase/ScalaExample.scala
index 08c10915df..45df6f6319 100644
---
a/spark/common/src/main/scala/org/apache/sedona/core/showcase/ScalaExample.scala
+++
b/spark/common/src/main/scala/org/apache/sedona/core/showcase/ScalaExample.scala
@@ -73,7 +73,7 @@ object ScalaExample extends App {
testDistanceJoinQuery()
testDistanceJoinQueryUsingIndex()
sc.stop()
- System.out.println("All DEMOs passed!")
+ println("All DEMOs passed!")
/**
* Test spatial range query.
diff --git
a/spark/common/src/main/scala/org/apache/sedona/stats/autocorrelation/Moran.scala
b/spark/common/src/main/scala/org/apache/sedona/stats/autocorrelation/Moran.scala
index 8e38cfdd0b..1edba9eb64 100644
---
a/spark/common/src/main/scala/org/apache/sedona/stats/autocorrelation/Moran.scala
+++
b/spark/common/src/main/scala/org/apache/sedona/stats/autocorrelation/Moran.scala
@@ -19,7 +19,6 @@
package org.apache.sedona.stats.autocorrelation
import org.apache.commons.math3.distribution.NormalDistribution
-import org.apache.sedona.stats.autocorrelation.MoranResult
import org.apache.spark.sql.{DataFrame, functions}
import org.apache.spark.sql.functions.{col, explode, pow}
diff --git
a/spark/common/src/main/scala/org/apache/sedona/viz/showcase/ScalaExample.scala
b/spark/common/src/main/scala/org/apache/sedona/viz/showcase/ScalaExample.scala
index 4332fa4591..a7be8a3251 100644
---
a/spark/common/src/main/scala/org/apache/sedona/viz/showcase/ScalaExample.scala
+++
b/spark/common/src/main/scala/org/apache/sedona/viz/showcase/ScalaExample.scala
@@ -44,6 +44,7 @@ object ScalaExample extends App {
Logger.getLogger("akka").setLevel(Level.WARN)
val prop = new Properties()
val resourcePath = "/../spark/common/src/test/resources/"
+ var ConfFile = new FileInputStream(resourcePath + "babylon.point.properties")
val demoOutputPath = "target/demo"
val scatterPlotOutputPath =
System.getProperty("user.dir") + "/" + demoOutputPath + "/scatterplot"
@@ -96,7 +97,6 @@ object ScalaExample extends App {
val HDFDataVariableList = Array("LST", "QC", "Error_LST", "Emis_31",
"Emis_32")
val HDFswitchXY = true
val urlPrefix = System.getProperty("user.dir") +
"/../spark/common/src/test/resources/modis/"
- var ConfFile = new FileInputStream(resourcePath + "babylon.point.properties")
if (buildScatterPlot(scatterPlotOutputPath) &&
buildHeatMap(heatMapOutputPath)
&& buildChoroplethMap(choroplethMapOutputPath) &&
parallelFilterRenderStitch(
@@ -104,8 +104,8 @@ object ScalaExample extends App {
&& parallelFilterRenderNoStitch(
parallelFilterRenderStitchOutputPath) && earthdataVisualization(
earthdataScatterPlotOutputPath))
- System.out.println("All 5 Demos have passed.")
- else System.out.println("Demos failed.")
+ println("All 5 Demos have passed.")
+ else println("Demos failed.")
/**
* Builds the scatter plot.
diff --git
a/spark/common/src/main/scala/org/apache/spark/sql/execution/datasources/geoparquet/GeoParquetMetaData.scala
b/spark/common/src/main/scala/org/apache/spark/sql/execution/datasources/geoparquet/GeoParquetMetaData.scala
index 053adf6fc7..c4649316f6 100644
---
a/spark/common/src/main/scala/org/apache/spark/sql/execution/datasources/geoparquet/GeoParquetMetaData.scala
+++
b/spark/common/src/main/scala/org/apache/spark/sql/execution/datasources/geoparquet/GeoParquetMetaData.scala
@@ -141,14 +141,12 @@ object GeoParquetMetaData {
// We are not using transformField here for binary compatibility with
various json4s versions shipped with
// Spark 3.0.x ~ Spark 3.5.x
- val serializedGeoObject = geoObject.underscoreKeys mapField {
- case field @ (jField: JField) =>
- if (jField._1 == "columns") {
- JField("columns", JObject(columnsMap.toList))
- } else {
- field
- }
- case field: Any => field
+ val serializedGeoObject = geoObject.underscoreKeys mapField { case field @
(jField: JField) =>
+ if (jField._1 == "columns") {
+ JField("columns", JObject(columnsMap.toList))
+ } else {
+ field
+ }
}
compactJson(serializedGeoObject)
}
diff --git
a/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/BroadcastIndexJoinExec.scala
b/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/BroadcastIndexJoinExec.scala
index 8f57894f8d..854d851086 100644
---
a/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/BroadcastIndexJoinExec.scala
+++
b/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/BroadcastIndexJoinExec.scala
@@ -118,6 +118,9 @@ case class BroadcastIndexJoinExec(
case (Some(r), _, false) => s"ST_Distance($windowExpression,
$objectExpression) < $r"
case (None, _, false) => s"ST_$spatialPredicate($windowExpression,
$objectExpression)"
case (None, _, true) => s"RS_$spatialPredicate($windowExpression,
$objectExpression)"
+ case (Some(r), _, true) =>
+ throw new UnsupportedOperationException(
+ "Distance joins are not supported for raster predicates")
}
override def simpleString(maxFields: Int): String =
diff --git
a/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinQueryDetector.scala
b/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinQueryDetector.scala
index 1e15051188..965e702afa 100644
---
a/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinQueryDetector.scala
+++
b/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinQueryDetector.scala
@@ -786,6 +786,14 @@ class JoinQueryDetector(sparkSession: SparkSession)
extends SparkStrategy {
case (Some(_), _, true, _, false) => "ST_Distance (Geography) <"
case (None, _, false, _, false) => s"ST_$spatialPredicate"
case (None, _, false, _, true) => s"RS_$spatialPredicate"
+ case (None, _, true, _, false) =>
+ throw new UnsupportedOperationException("Geography joins are not yet
supported")
+ case (None, _, true, _, true) =>
+ throw new UnsupportedOperationException(
+ "Geography joins are not yet supported for raster predicates")
+ case (Some(_), _, _, _, true) =>
+ throw new UnsupportedOperationException(
+ "Distance joins are not supported for raster predicates")
}
val (distanceOnIndexSide, distanceOnStreamSide) = distance
.map { distanceExpr =>
diff --git
a/spark/common/src/test/java/org/apache/sedona/core/spatialPartitioning/quadtree/RenderQuadTree.java
b/spark/common/src/test/java/org/apache/sedona/core/spatialPartitioning/quadtree/RenderQuadTree.java
index 6a6afba5bb..3bbb2e99cb 100644
---
a/spark/common/src/test/java/org/apache/sedona/core/spatialPartitioning/quadtree/RenderQuadTree.java
+++
b/spark/common/src/test/java/org/apache/sedona/core/spatialPartitioning/quadtree/RenderQuadTree.java
@@ -22,10 +22,14 @@ import java.awt.Color;
import java.awt.Graphics;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
@SuppressWarnings("serial")
public class RenderQuadTree extends QuadTreePanel {
+ private static final Logger log =
LoggerFactory.getLogger(RenderQuadTree.class);
+
protected StandardQuadTree<QuadRectangle> standardQuadTree;
int resolutionX = 600;
int resolutionY = 600;
@@ -105,7 +109,7 @@ public class RenderQuadTree extends QuadTreePanel {
List<QuadRectangle> matchedPartitions =
standardQuadTree.findZones(quadRectangle);
for (QuadRectangle q : matchedPartitions) {
g.drawRect((int) q.x, (int) q.y, (int) q.width, (int) q.height);
- System.out.println(q.partitionId);
+ log.debug("partitionId: {}", q.partitionId);
}
}
}
diff --git
a/spark/common/src/test/java/org/apache/sedona/viz/NYCTripPointMapper.java
b/spark/common/src/test/java/org/apache/sedona/viz/NYCTripPointMapper.java
index 5330f5ec27..5dc9300dcd 100644
--- a/spark/common/src/test/java/org/apache/sedona/viz/NYCTripPointMapper.java
+++ b/spark/common/src/test/java/org/apache/sedona/viz/NYCTripPointMapper.java
@@ -28,12 +28,16 @@ import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.LineString;
import org.locationtech.jts.geom.Point;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
// TODO: Auto-generated Javadoc
/** The Class NYCTripPointMapper. */
class NYCTripPointMapper implements FlatMapFunction<String, Object> {
+ private static final Logger log =
LoggerFactory.getLogger(NYCTripPointMapper.class);
+
/** The result. */
List<Point> result = new ArrayList<Point>();
@@ -54,7 +58,7 @@ class NYCTripPointMapper implements FlatMapFunction<String,
Object> {
} catch (NumberFormatException e) {
return result.iterator();
} catch (ArrayIndexOutOfBoundsException e) {
- System.out.println(line);
+ log.warn("ArrayIndexOutOfBoundsException for line: {}", line);
// e.printStackTrace();
}
diff --git a/spark/common/src/test/resources/log4j2.properties
b/spark/common/src/test/resources/log4j2.properties
index 5f89859463..d8d3e11c90 100644
--- a/spark/common/src/test/resources/log4j2.properties
+++ b/spark/common/src/test/resources/log4j2.properties
@@ -16,7 +16,7 @@
#
# Set everything to be logged to the file target/unit-tests.log
-rootLogger.level = info
+rootLogger.level = warn
rootLogger.appenderRef.file.ref = File
appender.file.type = File
diff --git a/spark/spark-3.4/src/test/resources/log4j2.properties
b/spark/spark-3.4/src/test/resources/log4j2.properties
index 683ecd32f2..1bd1963e7b 100644
--- a/spark/spark-3.4/src/test/resources/log4j2.properties
+++ b/spark/spark-3.4/src/test/resources/log4j2.properties
@@ -16,7 +16,7 @@
# under the License.
# Set everything to be logged to the file target/unit-tests.log
-rootLogger.level = info
+rootLogger.level = warn
rootLogger.appenderRef.file.ref = File
appender.file.type = File
diff --git a/spark/spark-3.5/src/test/resources/log4j2.properties
b/spark/spark-3.5/src/test/resources/log4j2.properties
index 683ecd32f2..1bd1963e7b 100644
--- a/spark/spark-3.5/src/test/resources/log4j2.properties
+++ b/spark/spark-3.5/src/test/resources/log4j2.properties
@@ -16,7 +16,7 @@
# under the License.
# Set everything to be logged to the file target/unit-tests.log
-rootLogger.level = info
+rootLogger.level = warn
rootLogger.appenderRef.file.ref = File
appender.file.type = File
diff --git a/spark/spark-4.0/src/test/resources/log4j2.properties
b/spark/spark-4.0/src/test/resources/log4j2.properties
index 683ecd32f2..1bd1963e7b 100644
--- a/spark/spark-4.0/src/test/resources/log4j2.properties
+++ b/spark/spark-4.0/src/test/resources/log4j2.properties
@@ -16,7 +16,7 @@
# under the License.
# Set everything to be logged to the file target/unit-tests.log
-rootLogger.level = info
+rootLogger.level = warn
rootLogger.appenderRef.file.ref = File
appender.file.type = File
diff --git a/spark/spark-4.1/src/test/resources/log4j2.properties
b/spark/spark-4.1/src/test/resources/log4j2.properties
index 683ecd32f2..1bd1963e7b 100644
--- a/spark/spark-4.1/src/test/resources/log4j2.properties
+++ b/spark/spark-4.1/src/test/resources/log4j2.properties
@@ -16,7 +16,7 @@
# under the License.
# Set everything to be logged to the file target/unit-tests.log
-rootLogger.level = info
+rootLogger.level = warn
rootLogger.appenderRef.file.ref = File
appender.file.type = File