Skip to content

RasterUDT Failing to Write to Delta Format; But works with output of RS_Union_Aggr #2608

@bransonf

Description

@bransonf

I am getting weird behavior trying to write a DataFrame containing the raster type to a delta table. The bare raster type fails to write, throwing: java.lang.NoSuchMethodException: org.apache.spark.sql.sedona_sql.UDT.RasterUDT$.<init>()

from sedona.spark import *
sedona = SedonaContext.create(spark)

ras = sedona.sql("SELECT RS_MakeEmptyRaster(1, 'D', 10, 10, 0, 0, 1, -1, 0, 0, 0) as raster")
ras.write.format("delta").save("/tmp/ras")
  • Throws the exception
ras2 = sedona.sql("SELECT RS_Union_Aggr(RS_MakeEmptyRaster(1, 'D', 10, 10, 0, 0, 1, -1, 0, 0, 0), 0) as raster")
ras2.write.format("delta").save("/tmp/ras2")
  • Writes without issue
  • Loads without any signs of corruption
ras3 = sedona.read.load("/tmp/ras2")

ras3.selectExpr(
  "explode(RS_PixelAsPoints(raster, 1)) as exploded"
).selectExpr(
  "exploded.geom as geom",
  "exploded.value as value",
  "exploded.x as x",
  "exploded.y as y"
).show()

Behavior is identical on both

Databricks 17.3 LTS + Sedona 1.8.1
Databiricks 16.4 LTS + Sedona 1.7.1

with and without the Kryo config

spark.serializer org.apache.spark.serializer.KryoSerializer
spark.kryo.registrator org.apache.sedona.core.serde.SedonaKryoRegistrator

Any assistance would be greatly appreciated, and happy to provide additional information as necessary. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions