comphead commented on code in PR #7053:
URL: https://github.com/apache/datafusion-comet/pull/7053#discussion_r4361445291
##########
native/core/src/execution/operators/parquet_writer.rs:
##########
@@ -514,8 +530,15 @@ impl ExecutionPlan for ParquetWriterExec {
let part_file = self.output_path.clone();
// Configure writer properties
+ let key_value_metadata = self.spark_version.as_ref().map(|version| {
+ vec![KeyValue::new(
+ SPARK_VERSION_METADATA_KEY.to_string(),
+ version.clone(),
+ )]
+ });
Review Comment:
A proto3 string field with presence tracking can arrive as `Some("")`, which
this writes as an empty `org.apache.spark.version`. The reader compares
versions lexicographically, so an empty value sorts below `3.0.0` and the file
reads as legacy, which is worse than omitting the key. Both Scala callers
always send `SPARK_VERSION_SHORT`, so only a hand-built plan reaches it. A
`.filter(|v| !v.is_empty())` before the `map` would cover it, and if I read
#5048 correctly it has the same guard.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]