codope commented on code in PR #9761: URL: https://github.com/apache/hudi/pull/9761#discussion_r1368140158
########## hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieMultiFileFormatRelation.scala: ########## @@ -0,0 +1,232 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.hudi + +import org.apache.hadoop.conf.Configuration +import org.apache.hadoop.fs.Path +import org.apache.hudi.HoodieBaseRelation.projectReader +import org.apache.hudi.HoodieConversionUtils.toScalaOption +import org.apache.hudi.HoodieMultiFileFormatRelation.{createPartitionedFile, inferFileFormat} +import org.apache.hudi.common.fs.FSUtils +import org.apache.hudi.common.model.{FileSlice, HoodieFileFormat, HoodieLogFile} +import org.apache.hudi.common.table.HoodieTableMetaClient +import org.apache.spark.rdd.RDD +import org.apache.spark.sql.SQLContext +import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.catalyst.expressions.Expression +import org.apache.spark.sql.execution.datasources.{FilePartition, PartitionedFile} +import org.apache.spark.sql.sources.Filter +import org.apache.spark.sql.types.StructType + +import scala.jdk.CollectionConverters.asScalaIteratorConverter + +/** + * Base split for all Hoodie multi-file format relations. + */ +case class HoodieMultiFileFormatSplit(baseFile: Option[PartitionedFile], + logFiles: List[HoodieLogFile]) extends HoodieFileSplit + +/** + * Base relation to handle table with multiple base file formats. + */ +abstract class BaseHoodieMultiFileFormatRelation(override val sqlContext: SQLContext, + override val metaClient: HoodieTableMetaClient, Review Comment: Coversion to `HadoopFsRelation` happens while resolving `BaseFileOnlyRelation` in `DefaultSource` - https://github.com/apache/hudi/blob/bb8fc3e9f632a1fc3647fda63d482849355df2b7/hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/DefaultSource.scala#L331 At this point, we don't know the file format. Previoulsy, it used to work because the code was written with the assumption that there will be just single base file format, either Parquet or Orc. -- 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]
