YannByron commented on code in PR #6727:
URL: https://github.com/apache/hudi/pull/6727#discussion_r979390313
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/EmptyRelation.scala:
##########
@@ -19,31 +19,17 @@
package org.apache.hudi
-import org.apache.hudi.common.table.{HoodieTableMetaClient,
TableSchemaResolver}
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.sources.{BaseRelation, TableScan}
import org.apache.spark.sql.types.StructType
import org.apache.spark.sql.{Row, SQLContext}
-import scala.util.control.NonFatal
-
/**
* BaseRelation representing empty RDD.
* @param sqlContext instance of SqlContext.
*/
-class EmptyRelation(val sqlContext: SQLContext, metaClient:
HoodieTableMetaClient) extends BaseRelation with TableScan {
-
- override def schema: StructType = {
- // do the best to find the table schema.
- val schemaResolver = new TableSchemaResolver(metaClient)
- try {
- val avroSchema = schemaResolver.getTableAvroSchema
- AvroConversionUtils.convertAvroSchemaToStructType(avroSchema)
- } catch {
- case NonFatal(e) =>
- StructType(Nil)
Review Comment:
see this: https://github.com/apache/hudi/pull/6476#discussion_r971394729
--
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]