diff --git a/geomesa-fs/geomesa-fs-storage/geomesa-fs-storage-parquet/src/main/scala/org/locationtech/geomesa/fs/storage/parquet/io/SimpleFeatureWriteSupport.scala b/geomesa-fs/geomesa-fs-storage/geomesa-fs-storage-parquet/src/main/scala/org/locationtech/geomesa/fs/storage/parquet/io/SimpleFeatureWriteSupport.scala index 40063cb1ae0c..3faf4f83f53b 100644 --- a/geomesa-fs/geomesa-fs-storage/geomesa-fs-storage-parquet/src/main/scala/org/locationtech/geomesa/fs/storage/parquet/io/SimpleFeatureWriteSupport.scala +++ b/geomesa-fs/geomesa-fs-storage/geomesa-fs-storage-parquet/src/main/scala/org/locationtech/geomesa/fs/storage/parquet/io/SimpleFeatureWriteSupport.scala @@ -59,7 +59,11 @@ class SimpleFeatureWriteSupport(callback: (Envelope, Long) => Unit) extends Writ def getCount: Long = count - override protected def onClose(bounds: Envelope, count: Long): Unit = {} + // Invoke the callback function for adding bounds to the storage metadata partition + override protected def onClose(bounds: Envelope, count: Long): Unit = { + println("MultipleGeometriesObserver onClose") + callback(bounds, count) + } } private val observer = new MultipleGeometriesObserver @@ -84,10 +88,7 @@ class SimpleFeatureWriteSupport(callback: (Envelope, Long) => Unit) extends Writ override def finalizeWrite(): FinalizedWriteContext = { // Get the bounding boxes that span each geometry type val bboxes = observer.getBoundingBoxes - - for (bbox <- bboxes) { - callback(bbox, observer.getCount) - } + observer.close() // If the SFT has no geometries, then there's no need to create GeoParquet metadata if (bboxes.isEmpty) {