Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SEDONA-412] pre-commit: add hook end-of-file-fixer #1062

Merged
merged 1 commit into from
Oct 27, 2023
Merged
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
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ repos:
- id: check-xml
# - id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
files: \.java$|\.scala$
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,3 @@ public String getDelimiter()
return this.splitter;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ public static Geometry envelope(GridCoverage2D raster) throws FactoryException {
int srid = RasterAccessors.srid(raster);
return new GeometryFactory(new PrecisionModel(), srid).toGeometry(envelope);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ public Polygon toPolygon() {
new Coordinate(this.startLon, this.startLat)
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ public void pointZ() {
assertEquals(4326, point.getSRID());
assertEquals("POINT Z(0 1 2)", Functions.asWKT(point));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,4 @@ public void lineStringCrossPentagonToCellsNonFullCover() {
assert approxCells.equals(cellsNonFullCover);
assert !approxCells.equals(cellsFullCover);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ private SpatialIndex generateIndex(int geomNum, Class aClass)
}
return quadtree;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ public void values() throws TransformException {
private Point point(double x, double y) {
return new GeometryFactory().createPoint(new Coordinate(x, y));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ object ScalaExample extends App{
sparkSession.stop()
}

}
}
2 changes: 1 addition & 1 deletion examples/spark-sql/src/main/scala/ScalaExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ object ScalaExample extends App{
df = df.selectExpr("RS_GetBand(data, 1, numBands) as targetBand")
df.selectExpr("RS_MultiplyFactor(targetBand, 3) as multiply").show()
}
}
}
2 changes: 1 addition & 1 deletion examples/spark-viz/src/main/scala/ScalaExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ object ScalaExample extends App{
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,3 @@ public void resetAccumulator (Accumulators.AccGeometry acc){
}
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -412,4 +412,4 @@ static long count(Table table) {
}
return count;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ public LineStringFormatMapper(Integer startOffset, Integer endOffset, FileDataSp
{
super(startOffset, endOffset, Splitter, carryInputData, GeometryType.LINESTRING);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ public PolygonFormatMapper(Integer startOffset, Integer endOffset, FileDataSplit
{
super(startOffset, endOffset, Splitter, carryInputData, GeometryType.POLYGON);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,4 @@ public BoundBox call(BoundBox box1, BoundBox box2)
}
else { return null; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,3 @@ public List<InputSplit> getSplits(JobContext job)
return splits;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -377,4 +377,4 @@ public static void testLoadShapefileIntoPolygonRDD()
e.printStackTrace();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,3 @@ public Polygon call(Polygon v1, Polygon v2)
return result;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -546,4 +546,4 @@ private void disposeNow(final MappedByteBuffer[] disposedBuffer)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ public String toString()
"height=" + image.getHeight() +
')';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ case class PythonRDDToJavaConverter(javaRDD: JavaRDD[Array[Byte]], geometrySeria
finalGeom
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ class SedonaSqlExtensions extends (SparkSessionExtensions => Unit) {
_ => ()
})
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ Catalog.aggregateExpressions.foreach(f => sparkSession.udf.register(f.getClass.g
Catalog.aggregateExpressions.foreach(f => sparkSession.sessionState.functionRegistry.dropFunction(FunctionIdentifier(f.getClass.getSimpleName))) // SPARK3 anchor
//Catalog.aggregateExpressions_UDAF.foreach(f => sparkSession.sessionState.functionRegistry.dropFunction(FunctionIdentifier(f.getClass.getSimpleName))) // SPARK2 anchor
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ trait SedonaBinaryExecNode extends SparkPlan {
}

protected def withNewChildrenInternal(newLeft: SparkPlan, newRight: SparkPlan): SparkPlan
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,3 @@ class ST_Intersection_Aggr extends Aggregator[Geometry, Geometry, Geometry] with
else buffer1.intersection(buffer2)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,3 @@ case class ST_MLineFromText(inputExpressions: Seq[Expression])
copy(inputExpressions = newChildren)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -1148,4 +1148,3 @@ case class ST_IsCollection(inputExpressions: Seq[Expression])
copy(inputExpressions = newChildren)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ case class RS_MinConvexHull(inputExpressions: Seq[Expression]) extends InferredE
copy(inputExpressions = newChildren)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,3 @@ case class RS_Array(inputExpressions: Seq[Expression])
copy(inputExpressions = newChildren)
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ case class RS_SetValue(inputExpressions: Seq[Expression]) extends InferredExpres
protected def withNewChildrenInternal(newChildren: IndexedSeq[Expression]) = {
copy(inputExpressions = newChildren)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ case class RS_AddBand(inputExpressions: Seq[Expression]) extends InferredExpress
protected def withNewChildrenInternal(newChildren: IndexedSeq[Expression]) = {
copy(inputExpressions = newChildren)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ case class RS_Resample(inputExpressions: Seq[Expression]) extends InferredExpres
protected def withNewChildrenInternal(newChildren: IndexedSeq[Expression]) = {
copy(inputExpressions = newChildren)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ case class RS_AsImage(inputExpressions: Seq[Expression]) extends InferredExpress
protected def withNewChildrenInternal(newChildren: IndexedSeq[Expression]) = {
copy(inputExpressions = newChildren)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ object st_aggregates extends DataFrameAPI {
val aggrFunc = udaf(new ST_Union_Aggr)
aggrFunc(col(geometry))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -425,4 +425,4 @@ object st_functions extends DataFrameAPI {
def ST_IsCollection(geometry: String): Column = wrapExpression[ST_IsCollection](geometry)

}


Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ private[io] class RasterOptions(@transient private val parameters: CaseInsensiti
val rasterPathField = parameters.get("pathField")
// Column of the raster image itself
val rasterField = parameters.get("rasterField")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ protected static void deleteFile(String path)
fileSystem.delete(new Path(path), true);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -366,4 +366,4 @@ public void testParseBoundary()
Assert.assertEquals(gtlbounds, myBounds);
gtlReader.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ public void testSpatialRangeQueryUsingIndex()
assert resultSize > -1;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ public void testSpatialKnnQueryUsingIndex()
//System.out.println(result.get(0).getUserData().toString());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,4 @@ public void testSpatialRangeQueryUsingIndex()
}
assert RangeQuery.SpatialRangeQuery(spatialRDD, queryEnvelope, false, true).take(10).get(1).getUserData().toString() != null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ public void testSpatialKnnQueryTopKlargerThanRowNumber()
assert result.size() == 1;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@ public void testSpatialRangeQueryUsingIndex()
assertEquals(resultSize, 2830);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,4 @@ public void testSpatialKNNCorrectness()
}
assert difference == 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ public void testSpatialRangeQueryUsingIndex()
}
assert RangeQuery.SpatialRangeQuery(spatialRDD, queryEnvelope, false, true).take(10).get(1).getUserData().toString() != null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,4 @@ public void testSpatialKNNCorrectness()
}
assert difference == 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@ public void testSpatialRangeQueryLeftCoveredByRightFalse()
assertEquals(useIndexResultSize, notUseIndexResultSize);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ private QuadRectangle makeRect(double x, double y, double width, double height)
{
return new QuadRectangle(x, y, width, height);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,4 @@ public void testQuadTreePartitionLineage()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ public void testBuildQuadtreeIndex()
List<Point> result = spatialRDD.indexedRDD.take(1).get(0).query(spatialRDD.boundaryEnvelope);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ public void testBuildQuadtreeIndex()
List<Point> result = spatialRDD.indexedRDD.take(1).get(0).query(spatialRDD.boundaryEnvelope);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ private void assertFailure(int numPartitions, long totalNumberOfRecords, int giv
// expected
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ public void testBytesFromString() {
assertEquals(1024, SedonaConf.bytesFromString("1k"));
assertEquals(2097152, SedonaConf.bytesFromString("2MB"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,3 @@ public Iterator call(String line)
return result.iterator();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ trait GeometrySample {
lines.toList
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ object Fixtures extends TableDrivenPropertyChecks {
def decodeGeoHash(geohash: String, precision: Int): Geometry =
GeoHashDecoder.decode(geohash, precision)

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -557,4 +557,4 @@ class GeometryTypesAndFunctionsTestScala extends TestBaseScala with BeforeAndAft
assert(actual == "POLYGON ((48 6, 52 18, 66 23, 73 9, 48 6))")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
* This package contains compliance tests for OGC simple feature access part two version 1.2.1.
* https://www.ogc.org/standards/sfs
*/
package org.apache.sedona.sql.ogc;
package org.apache.sedona.sql.ogc;
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ class rasterIOTest extends TestBaseScala with BeforeAndAfter with GivenWhenThen
}

override def afterAll(): Unit = FileUtils.deleteDirectory(new File(tempDir))
}
}
Loading
Loading