jonvex commented on code in PR #10957:
URL: https://github.com/apache/hudi/pull/10957#discussion_r1571152424
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/HoodieFileGroupReaderBasedParquetFileFormat.scala:
##########
@@ -107,19 +112,23 @@ class
HoodieFileGroupReaderBasedParquetFileFormat(tableState: HoodieTableState,
val dataSchema =
StructType(tableSchema.structTypeSchema.fields.filterNot(f =>
partitionColumns.contains(f.name)))
val outputSchema = StructType(requiredSchema.fields ++
partitionSchema.fields)
spark.conf.set("spark.sql.parquet.enableVectorizedReader",
supportBatchResult)
- val requiredSchemaWithMandatory =
generateRequiredSchemaWithMandatory(requiredSchema, dataSchema, partitionSchema)
- val isCount = requiredSchemaWithMandatory.isEmpty
- val requiredSchemaSplits = requiredSchemaWithMandatory.fields.partition(f
=> HoodieRecord.HOODIE_META_COLUMNS_WITH_OPERATION.contains(f.name))
- val requiredMeta = StructType(requiredSchemaSplits._1)
- val requiredWithoutMeta = StructType(requiredSchemaSplits._2)
+ val isCount = requiredSchema.isEmpty && !isMOR && !isIncremental
val augmentedHadoopConf = FSUtils.buildInlineConf(hadoopConf)
- val (baseFileReader, preMergeBaseFileReader, readerMaps, cdcFileReader) =
buildFileReaders(
- spark, dataSchema, partitionSchema, requiredSchema, filters, options,
augmentedHadoopConf,
- requiredSchemaWithMandatory, requiredWithoutMeta, requiredMeta)
+ setSchemaEvolutionConfigs(augmentedHadoopConf, options)
+ val baseFileReader = super.buildReaderWithPartitionValues(spark,
dataSchema, partitionSchema, requiredSchema,
+ filters ++ requiredFilters, options, new
Configuration(augmentedHadoopConf))
+ val cdcFileReader = super.buildReaderWithPartitionValues(
+ spark,
+ tableSchema.structTypeSchema,
+ StructType(Nil),
+ tableSchema.structTypeSchema,
+ Nil,
+ options,
+ new Configuration(hadoopConf))
val requestedAvroSchema =
AvroConversionUtils.convertStructTypeToAvroSchema(requiredSchema,
sanitizedTableName)
val dataAvroSchema =
AvroConversionUtils.convertStructTypeToAvroSchema(dataSchema,
sanitizedTableName)
-
+ val parquetFileReader =
spark.sparkContext.broadcast(sparkAdapter.createParquetFileReader(supportBatchResult,
spark.sessionState.conf, options, augmentedHadoopConf))
Review Comment:
No. The spark confs don't make it to the executors if you remember.
Instantiating the reader just gets the value of the configs we need so that we
can send them to the executor.
--
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]