nsivabalan commented on code in PR #12529:
URL: https://github.com/apache/hudi/pull/12529#discussion_r1894118908
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -519,15 +536,28 @@ private Pair<Integer, HoodieData<HoodieRecord>>
initializePartitionStatsIndex(Li
return Pair.of(fileGroupCount, records);
}
- private Pair<Integer, HoodieData<HoodieRecord>>
initializeColumnStatsPartition(Map<String, Map<String, Long>>
partitionToFilesMap) {
+ private Pair<List<String>, Pair<Integer, HoodieData<HoodieRecord>>>
initializeColumnStatsPartition(Map<String, Map<String, Long>>
partitionToFilesMap) {
+ // Find the columns to index
+ final List<String> columnsToIndex =
HoodieTableMetadataUtil.getColumnsToIndex(dataMetaClient.getTableConfig(),
+ dataWriteConfig.getMetadataConfig(), Lazy.lazily(() ->
HoodieTableMetadataUtil.tryResolveSchemaForTable(dataMetaClient)));
+ if (columnsToIndex.isEmpty()) {
+ // atleast meta fields will be chosen for indexing. So, we should not
reach this state.
Review Comment:
```
private static List<String> getColumnsToIndex(HoodieTableConfig
tableConfig,
HoodieMetadataConfig
metadataConfig,
Either<List<String>,
Lazy<Option<Schema>>> tableSchema,
Option<HoodieRecordType>
recordType) {
Stream<String> columnsToIndexWithoutRequiredMetas =
getColumnsToIndexWithoutRequiredMetaFields(metadataConfig, tableSchema,
recordType);
if (!tableConfig.populateMetaFields()) {
return columnsToIndexWithoutRequiredMetas.collect(Collectors.toList());
}
return Stream.concat(Arrays.stream(META_COLS_TO_ALWAYS_INDEX),
columnsToIndexWithoutRequiredMetas).collect(Collectors.toList());
}
```
So, already its accounted for.
--
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]