voonhous commented on code in PR #19849:
URL: https://github.com/apache/hudi/pull/19849#discussion_r3951044342


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieBaseRelation.scala:
##########
@@ -252,19 +241,7 @@ abstract class HoodieBaseRelation(val sqlContext: 
SQLContext,
     HoodieFileIndex(sparkSession, metaClient, Some(tableStructSchema), 
optParams,
       FileStatusCache.getOrCreate(sparkSession), shouldIncludeLogFiles())
 
-  lazy val tableState: HoodieTableState = {
-    val recordMergerImpls = 
optParams.get(HoodieWriteConfig.RECORD_MERGE_IMPL_CLASSES.key()).map(impls => 
ConfigUtils.split2List(impls).asScala.toList).getOrElse(List.empty)
-    // Subset of the state of table's configuration as of at the time of the 
query
-    HoodieTableState(tablePath = basePath.toString,
-      latestCommitTimestamp = queryTimestamp,
-      recordKeyField = recordKeyField,
-      orderingFields = orderingFields,
-      usesVirtualKeys = !tableConfig.populateMetaFields(),
-      metadataConfig = fileIndex.getMetadataConfig,
-      recordMergeImplClasses = recordMergerImpls,
-      recordMergeStrategyId = tableConfig.getRecordMergeStrategyId
-    )
-  }
+  protected lazy val latestCommitTimestamp: Option[String] = queryTimestamp

Review Comment:
   The rename settles the naming half, and the freeze rationale is right; 
agreed on keeping the capture-once semantics.
   
   The second half is still open though: `targetInstantTime` is a `protected 
lazy val` on `HoodieBaseRelation:244`, so `BaseFileOnlyRelation`, 
`HoodieBootstrapRelation` and `IncrementalRelation` all inherit a member only 
the three MOR relations read.
   
   Those three (`MergeOnReadSnapshotRelation`, 
`MergeOnReadIncrementalRelationV1`, `MergeOnReadIncrementalRelationV2`) all 
extend `BaseMergeOnReadSnapshotRelation`, so could the `lazy val` move there 
instead? Same capture-once timing, and the base class stops growing in a PR 
aimed at narrowing surface.
   



-- 
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]

Reply via email to