Skip to content

Commit 0a7f90c

Browse files
committed
Regression
1 parent e113ffd commit 0a7f90c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

datasource/src/test/scala/org/locationtech/rasterframes/datasource/raster/RasterSourceDataSourceSpec.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ package org.locationtech.rasterframes.datasource.raster
2323
import geotrellis.raster.Tile
2424
import org.apache.spark.sql.functions.{lit, round, udf}
2525
import org.apache.spark.sql.types.LongType
26-
import org.locationtech.rasterframes.{TestEnvironment, _}
2726
import org.locationtech.rasterframes.datasource.raster.RasterSourceDataSource.{RasterSourceCatalog, _}
2827
import org.locationtech.rasterframes.model.TileDimensions
2928
import org.locationtech.rasterframes.ref.RasterRef.RasterRefTile
3029
import org.locationtech.rasterframes.util._
30+
import org.locationtech.rasterframes.{TestEnvironment, _}
3131

3232
class RasterSourceDataSourceSpec extends TestEnvironment with TestData {
3333
import spark.implicits._
@@ -336,15 +336,16 @@ class RasterSourceDataSourceSpec extends TestEnvironment with TestData {
336336

337337
describe("attaching a spatial index") {
338338
val l8_df = spark.read.raster
339-
.withSpatialIndex()
339+
.withSpatialIndex(5)
340340
.load(remoteL8.toASCIIString)
341341
.cache()
342342

343343
it("should add index") {
344344
l8_df.columns should contain("spatial_index")
345345
l8_df.schema("spatial_index").dataType should be(LongType)
346-
l8_df.show(false)
347-
l8_df.select($"spatial_index").distinct().count() should be(l8_df.count())
346+
val parts = l8_df.rdd.partitions
347+
parts.length should be (5)
348+
parts.map(_.getClass.getSimpleName).forall(_ == "ShuffledRowRDDPartition") should be (true)
348349
}
349350
}
350351
}

0 commit comments

Comments
 (0)