mbutrovich commented on code in PR #1103:
URL: https://github.com/apache/datafusion-comet/pull/1103#discussion_r1852256631


##########
spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala:
##########
@@ -3191,9 +3191,25 @@ object QueryPlanSerde extends Logging with 
ShimQueryPlanSerde with CometExprShim
 
   private def partition2Proto(
       partition: FilePartition,
-      nativeScanBuilder: OperatorOuterClass.NativeScan.Builder): Unit = {
+      nativeScanBuilder: OperatorOuterClass.NativeScan.Builder,
+      scan: CometScanExec): Unit = {
     val partitionBuilder = OperatorOuterClass.SparkFilePartition.newBuilder()
+    val sparkContext = scan.session.sparkContext
+    var schema_saved: Boolean = false;
     partition.files.foreach(file => {
+      if (!schema_saved) {
+        // TODO: This code shouldn't be here, but for POC it's fine.
+        // Extract the schema and stash it.
+        val hadoopConf =
+          
scan.relation.sparkSession.sessionState.newHadoopConfWithOptions(scan.relation.options)
+        val broadcastedHadoopConf =
+          sparkContext.broadcast(new SerializableConfiguration(hadoopConf))
+        val sharedConf = broadcastedHadoopConf.value.value
+        val footer = FooterReader.readFooter(sharedConf, file)

Review Comment:
   It's actually part of parquet-hadoop: 
https://github.com/apache/parquet-java/blob/1e04ec74060a04cb029b6e61cf1098c1aba1446e/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetInputFormat.java#L525



-- 
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]

Reply via email to