jinchengchenghh commented on code in PR #11113:
URL: 
https://github.com/apache/incubator-gluten/pull/11113#discussion_r2537891261


##########
gluten-substrait/src/main/scala/org/apache/spark/sql/hive/HiveTableScanExecTransformer.scala:
##########
@@ -82,23 +82,52 @@ case class HiveTableScanExecTransformer(
   @transient private lazy val hivePartitionConverter =
     new HivePartitionConverter(session.sessionState.newHadoopConf(), session)
 
-  @transient private lazy val partitions: Seq[Partition] =
+  @transient private lazy val existsMixedInputFormat: Boolean =
+    prunedPartitions.exists(_.getInputFormatClass != 
tableDesc.getInputFileFormatClass)
+
+  @transient private lazy val partitions: Seq[(Seq[Partition], 
ReadFileFormat)] =
     if (!relation.isPartitioned) {
       val tableLocation: URI = 
relation.tableMeta.storage.locationUri.getOrElse {
         throw new UnsupportedOperationException("Table path not set.")
       }
-      hivePartitionConverter.createFilePartition(tableLocation)
+      Seq((hivePartitionConverter.createFilePartition(tableLocation), 
fileFormat))
+    } else if (existsMixedInputFormat) {
+      // Currently, we only consider the case where Hive table mix two 
different input format.
+      val (partitions1, partitions2) =
+        prunedPartitions.partition(_.getInputFormatClass == 
tableDesc.getInputFileFormatClass)
+      assert(partitions2.forall(_.getInputFormatClass == 
partitions2.head.getOutputFormatClass))
+
+      val anotherFileFormat = getFileFormat(

Review Comment:
   Can we add ReadFileFormat for each partition? This can support partition 
with any file format. There may be more than 2 file format



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