paleolimbot commented on code in PR #1116:
URL: https://github.com/apache/sedona-db/pull/1116#discussion_r3738735140
##########
rust/sedona-geoparquet/src/format.rs:
##########
@@ -391,7 +391,34 @@ impl FileFormat for GeoParquetFormat {
)
.unwrap();
source.options = self.options.clone();
- Arc::new(source)
+
+ // DataFusion 52 has an issue where field metadata (like
ARROW:extension:name)
+ // is stripped when evaluating embedded projections in ParquetOpener.
This is
+ // because the batch schema comes from the parquet reader (which
doesn't have
+ // extension metadata), and Column::return_field() looks up fields
from that schema.
+ // This isn't a bug in DataFusion because we're the ones that
advertised the table
+ // schema as having metadata'd expressions in the first place.
+ //
+ // We fix this by wrapping Column expressions with
MetadataPreservingColumn,
+ // which stores the correct field from the file schema and returns it
from
Review Comment:
There's a difference between the table schema that we have access to and the
table schema the Parquet opener uses to evaluate projections / filters. This is
not my favourite workaround...the idea is to "just wrap" the Parquet DataFusion
implementation but it's accumulated quite a bit of workarounds and it's not as
clean as I would like it to be.
All of this was rewritten on the Parquet end for each of the 53, 54, and 55
releases so we will have to redo these workarounds a few times in our future
😮💨
--
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]