wecharyu commented on code in PR #9889:
URL: https://github.com/apache/hudi/pull/9889#discussion_r1371295305
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/BaseFileOnlyRelation.scala:
##########
@@ -65,8 +65,11 @@ case class BaseFileOnlyRelation(override val sqlContext:
SQLContext,
// For more details please check HUDI-4161
// NOTE: This override has to mirror semantic of whenever this Relation is
converted into [[HadoopFsRelation]],
// which is currently done for all cases, except when Schema Evolution
is enabled
- override protected val shouldExtractPartitionValuesFromPartitionPath:
Boolean =
- internalSchemaOpt.isEmpty
+ override protected val shouldExtractPartitionValuesFromPartitionPath:
Boolean = {
+ if (hasSchemaOnRead) {
+ super.needExtractPartitionValuesFromPartitionPath()
+ } else true
Review Comment:
Which file do you mean? For this line change, we determine
`shouldExtractPartitionValuesFromPartitionPath` value as follows:
1) if schema evolution was applied, use value from super class which was
determined by configuration;
2) if schema evolution was not applied, we fall back to HaddooFsRelation,
and always read partition values from path, so set the value to true.
In the original behavior, if schema evolution was applied, it set
`shouldExtractPartitionValuesFromPartitionPath` as false directly. So if hudi
does not write partition data to files, it will not be able to read partition
values after schema evolution was applied.
--
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]