Skip to content

Commit 329764b

Browse files
committed
Added shading of Typesafe config.
1 parent b06c3d0 commit 329764b

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

core/src/main/scala/org/locationtech/rasterframes/expressions/aggregates/CellStatsAggregate.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ object CellStatsAggregate {
124124

125125
def apply(col: Column): TypedColumn[Any, CellStatistics] =
126126
new Column(new CellStatsAggregateUDAF(col.expr))
127-
.as(s"rf_agg_stats($col)") // node renaming in class doesn't seem to propogate
127+
.as(s"rf_agg_stats($col)") // node renaming in class doesn't seem to propagate
128128
.as[CellStatistics]
129129

130130
/** Adapter hack to allow UserDefinedAggregateFunction to be referenced as an expression. */

experimental/src/it/resources/log4j.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ log4j.logger.org.spark_project.jetty=WARN
3535
log4j.logger.org.spark_project.jetty.util.component.AbstractLifeCycle=ERROR
3636
log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO
3737
log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO
38-
log4j.logger.org.locationtech.rasterframes=DEBUG
38+
log4j.logger.org.locationtech.rasterframes=INFO
3939
log4j.logger.org.apache.parquet.hadoop.ParquetRecordReader=OFF
4040

4141
# SPARK-9183: Settings to avoid annoying messages when looking up nonexistent UDFs in SparkSQL with Hive support

experimental/src/it/scala/org/locationtech/rasterframes/experimental/datasource/awspds/MODISCatalogRelationTest.scala

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
package org.locationtech.rasterframes.experimental.datasource.awspds
2222
import java.sql.Timestamp
2323

24+
import geotrellis.proj4.LatLng
2425
import org.apache.spark.sql.functions._
2526
import org.locationtech.rasterframes._
2627
import org.locationtech.rasterframes.datasource.raster._
@@ -75,5 +76,32 @@ class MODISCatalogRelationTest extends TestEnvironment {
7576
stats.data_cells shouldBe > (128L)
7677
stats.mean shouldBe > (1000.0)
7778
}
79+
it("should compute aggregate statistics") {
80+
// This is copied from the docs.
81+
import spark.implicits._
82+
83+
val modis = spark.read.format("aws-pds-modis-catalog").load()
84+
85+
val red_nir_monthly_2017 = modis
86+
.select($"granule_id", month($"acquisition_date") as "month", $"B01" as "red", $"B02" as "nir")
87+
.where(year($"acquisition_date") === 2017 && (dayofmonth($"acquisition_date") === 15) && $"granule_id" === "h21v09")
88+
89+
val red_nir_tiles_monthly_2017 = spark.read.raster
90+
.fromCatalog(red_nir_monthly_2017, "red", "nir")
91+
.load()
92+
.cache()
93+
94+
val result = red_nir_tiles_monthly_2017
95+
.where(st_intersects(
96+
st_reproject(rf_geometry($"red"), rf_crs($"red"), LatLng),
97+
st_makePoint(34.870605, -4.729727)
98+
))
99+
.groupBy("month")
100+
.agg(rf_agg_stats(rf_normalized_difference($"nir", $"red")) as "ndvi_stats")
101+
.orderBy("month")
102+
.select("month", "ndvi_stats.*")
103+
104+
result.show()
105+
}
78106
}
79107
}

project/RFAssemblyPlugin.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ object RFAssemblyPlugin extends AutoPlugin {
5555
"org.apache.avro",
5656
"org.apache.http",
5757
"com.google.guava",
58-
"com.typesafe.scalalogging"
58+
"com.typesafe.scalalogging",
59+
"com.typesafe.config"
5960
)
6061
shadePrefixes.map(p ShadeRule.rename(s"$p.**" -> s"rf.shaded.$p.@1").inAll)
6162
},

0 commit comments

Comments
 (0)