parthchandra commented on code in PR #1621: URL: https://github.com/apache/datafusion-comet/pull/1621#discussion_r2036049975
########## spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala: ########## @@ -246,6 +183,65 @@ class CometSparkSessionExtensions } } + private def transformV2Scan(scanExec: BatchScanExec): SparkPlan = { + + scanExec.scan match { + case scan: ParquetScan => + val fallbackReasons = new ListBuffer[String]() + if (!CometBatchScanExec.isSchemaSupported(scan.readDataSchema)) { + fallbackReasons += s"Schema ${scan.readDataSchema} is not supported" + } + + if (!CometBatchScanExec.isSchemaSupported(scan.readPartitionSchema)) { + fallbackReasons += s"Partition schema ${scan.readPartitionSchema} is not supported" + } + + if (scan.pushedAggregate.nonEmpty) { + fallbackReasons += "Comet does not support pushed aggregate" + } + + if (fallbackReasons.isEmpty) { + val cometScan = CometParquetScan(scanExec.scan.asInstanceOf[ParquetScan]) + logInfo("Comet extension enabled for Scan") + CometBatchScanExec( + scanExec.copy(scan = cometScan), + runtimeFilters = scanExec.runtimeFilters) + } else { + withInfo(scanExec, withInfo(scanExec, fallbackReasons.mkString(", "))) Review Comment: How did this compile ?? -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org