wForget commented on code in PR #2828:
URL: https://github.com/apache/datafusion-comet/pull/2828#discussion_r2579225731
##########
native/core/src/execution/operators/parquet_writer.rs:
##########
@@ -264,14 +300,30 @@ impl ExecutionPlan for ParquetWriterExec {
DataFusionError::Execution(format!("Failed to close writer:
{}", e))
})?;
+ // Get file size
+ let file_size = std::fs::metadata(&part_file)
+ .map(|m| m.len() as i64)
+ .unwrap_or(0);
+
+ // Update metrics with write statistics
+ files_written.add(1);
+ bytes_written.add(file_size as usize);
+ rows_written.add(total_rows as usize);
+
+ // Log metadata for debugging
+ eprintln!(
+ "Wrote Parquet file: path={}, size={}, rows={}",
+ part_file, file_size, total_rows
+ );
+
// Return empty stream to indicate completion
Ok::<_, DataFusionError>(futures::stream::empty())
};
// Execute the write task and convert to a stream
use datafusion::physical_plan::stream::RecordBatchStreamAdapter;
Ok(Box::pin(RecordBatchStreamAdapter::new(
- output_schema,
+ self.schema(),
Review Comment:
Why change to `input schema`? The batch is converted into output schema in
`write_task`.
--
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]