jiayuasu commented on issue #1031:
URL: https://github.com/apache/sedona/issues/1031#issuecomment-1738373305
@sebbegg We think the solution is gonna be:
Step 1: force the schema for the native parquet reader. Force the geom field
to be ArrayType Byte:
```
ProductCustomSchema = StructType([
StructField("id_sku", IntegerType(), True),
StructField("flag_piece", StringType(), True),
StructField("flag_weight", StringType(), True),
StructField("ds_sku", StringType(), True),
StructField("qty_pack", FloatType(), True)]),
StructField("geom", ArrayType(Byte), True)])
spark.read.format("parquet").schema(schema).path("")
```
Step 2: if the loader can load the data, you might then need to convert the
ArrayType geom to Binary type using a UDF like this
```
val binUdf = udf((arr:WrappedArray[Byte]) => {arr.to.map(_.toByte)})
df.withColumn("Values",binUdf($"Values")).printSchema
```
Step 3: then use `ST_GeomFromWKB` to create the geom column in Sedona 1.4.1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]