You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "cshuo (via GitHub)" <gi...@apache.org> on 2026/07/24 08:23:53 UTC
[PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
cshuo opened a new pull request, #19373:
URL: https://github.com/apache/hudi/pull/19373
### Describe the issue this Pull Request addresses
Closes #19372.
Flink v10 metadata tables currently remain on the default storage layout, so metadata lookups continue to use the classic file-group reader even though native logs can be consumed as sorted LSM runs.
### Summary and Changelog
- Persist `hoodie.table.storage.layout=lsm_tree` for newly created Flink metadata tables on table version 10 or later.
- Preserve the existing persisted configuration for other engines and older table versions.
- Use `HoodieLsmFileGroupReader` for LSM metadata-table slices containing only native logs.
- Fall back to `HoodieFileGroupReader` for the default layout and slices containing legacy inline logs.
- Disable reusable base/log reader caching on the LSM path while preserving the existing classic-reader reuse behavior.
- Add Flink metadata-table coverage for the persisted layout, initial native HFile log, multi-log `files` partition lookups, and equivalent results with reuse enabled and disabled.
### Impact
New Flink v10 metadata tables use the LSM storage layout and reader automatically. Existing metadata tables, older table versions, other engines, public APIs, and the classic metadata-reader cache behavior are unchanged.
### Risk Level
Medium. This changes the storage layout and read path selected for newly created Flink v10 metadata tables. The change is isolated by the persisted layout and native-log checks, with a classic-reader fallback for legacy or mixed slices.
Validation:
- `TestHoodieBackedTableMetadataWriter#tableStorageLayoutForMetadataTable`
- `TestStreamWriteOperatorCoordinator#testSyncMetadataTable` with Flink 2.1
- `TestHoodieBackedTableMetadata#testTableOperations` across reuse enabled/disabled and table versions 6, 8, and current
### Documentation Update
None. This does not add a user-facing option or change the default layout of data tables; it changes the internal layout selected for newly created Flink v10 metadata tables.
### Contributor's checklist
- [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
- [x] Enough context is provided in the sections above
- [x] Adequate tests were added if applicable
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5068960475
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
}, {
"hash" : "80973325815a50b3988d464c81cde7d58740b0fb",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "80973325815a50b3988d464c81cde7d58740b0fb",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 5691ca3446f8db4c282da45566cf29945c844a68 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689)
* 80973325815a50b3988d464c81cde7d58740b0fb UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "cshuo (via GitHub)" <gi...@apache.org>.
cshuo commented on code in PR #19373:
URL: https://github.com/apache/hudi/pull/19373#discussion_r3656775808
##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -571,9 +573,10 @@ private ClosableIterator<IndexedRecord> readSliceWithFilter(Predicate predicate,
.explicitInstants(validInstantTimestamps).build());
// If reuse is enabled and full scan is allowed for the partition, we can reuse the file readers for base files and the reader context for the log files.
+ boolean shouldReuse = reuse && isFullScanAllowedForPartition(fileSlice.getPartitionPath());
+ boolean useLsmReader = !shouldReuse && shouldUseLsmReader(metadataMetaClient, fileSlice);
Review Comment:
MDT uses HFile as its fixed base-file format, and native logs are written using the table's base-file format, so MDT native logs are HFile as well. `HoodieAvroReaderContext#getFileRecordIterator` applies the key/prefix filter through `HoodieNativeAvroHFileReader`, which supports both predicates. Therefore, the LSM log iterators are already filtered for this MDT path.
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5068717225
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 5691ca3446f8db4c282da45566cf29945c844a68 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5069916185
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
}, {
"hash" : "80973325815a50b3988d464c81cde7d58740b0fb",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695",
"triggerID" : "80973325815a50b3988d464c81cde7d58740b0fb",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 80973325815a50b3988d464c81cde7d58740b0fb Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-agent (via GitHub)" <gi...@apache.org>.
hudi-agent commented on code in PR #19373:
URL: https://github.com/apache/hudi/pull/19373#discussion_r3656656565
##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -571,9 +573,10 @@ private ClosableIterator<IndexedRecord> readSliceWithFilter(Predicate predicate,
.explicitInstants(validInstantTimestamps).build());
// If reuse is enabled and full scan is allowed for the partition, we can reuse the file readers for base files and the reader context for the log files.
+ boolean shouldReuse = reuse && isFullScanAllowedForPartition(fileSlice.getPartitionPath());
+ boolean useLsmReader = !shouldReuse && shouldUseLsmReader(metadataMetaClient, fileSlice);
Review Comment:
🤖 When `useLsmReader` is chosen (reuse off), the key filter carried by `readerContext` doesn't get applied to native log records. Native parquet log readers return `false` from `supportKeyPredicate()`/`supportKeyPrefixPredicate()`, so `LsmFileIterators` reads every record in the log file, whereas the classic path derives a `KeySpec` from the same filter (`HoodieMergedLogRecordReader.createKeySpec`) and filters log records by the requested keys/prefixes. Since `getRecordsByKeyPrefixes`/`readIndexRecordsWithKeys` map every returned record by its own key with no post-reader key re-filter, the LSM reader can emit records for keys/prefixes that weren't requested (and only partially merged, since their base entries weren't seeked). FILES lookups happen to be safe because consumers look up by the requested key, but RECORD_INDEX/SECONDARY_INDEX/COLUMN_STATS point/prefix lookups (reuse off) would be affected. @nsivabalan could you confirm whether the requested-key/prefix filter needs to
be applied to the LSM log records here?
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag quality.</i></sub>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5087718386
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
}, {
"hash" : "80973325815a50b3988d464c81cde7d58740b0fb",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695",
"triggerID" : "80973325815a50b3988d464c81cde7d58740b0fb",
"triggerType" : "PUSH"
}, {
"hash" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15720",
"triggerID" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"triggerType" : "PUSH"
}, {
"hash" : "32f08444569e728f91b9cd17f05c52441e2a3489",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15721",
"triggerID" : "32f08444569e728f91b9cd17f05c52441e2a3489",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 32f08444569e728f91b9cd17f05c52441e2a3489 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15721)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5086822777
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
}, {
"hash" : "80973325815a50b3988d464c81cde7d58740b0fb",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695",
"triggerID" : "80973325815a50b3988d464c81cde7d58740b0fb",
"triggerType" : "PUSH"
}, {
"hash" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15720",
"triggerID" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 80973325815a50b3988d464c81cde7d58740b0fb Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695)
* e70f80066898c8bef21642a5c01e7884fa62efbd Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15720)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5069017649
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
}, {
"hash" : "80973325815a50b3988d464c81cde7d58740b0fb",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695",
"triggerID" : "80973325815a50b3988d464c81cde7d58740b0fb",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 5691ca3446f8db4c282da45566cf29945c844a68 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689)
* 80973325815a50b3988d464c81cde7d58740b0fb Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5087173901
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
}, {
"hash" : "80973325815a50b3988d464c81cde7d58740b0fb",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695",
"triggerID" : "80973325815a50b3988d464c81cde7d58740b0fb",
"triggerType" : "PUSH"
}, {
"hash" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15720",
"triggerID" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"triggerType" : "PUSH"
}, {
"hash" : "32f08444569e728f91b9cd17f05c52441e2a3489",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15721",
"triggerID" : "32f08444569e728f91b9cd17f05c52441e2a3489",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 80973325815a50b3988d464c81cde7d58740b0fb Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695)
* e70f80066898c8bef21642a5c01e7884fa62efbd Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15720)
* 32f08444569e728f91b9cd17f05c52441e2a3489 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15721)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 merged PR #19373:
URL: https://github.com/apache/hudi/pull/19373
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-agent (via GitHub)" <gi...@apache.org>.
hudi-agent commented on code in PR #19373:
URL: https://github.com/apache/hudi/pull/19373#discussion_r3654144169
##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -606,20 +609,39 @@ private ClosableIterator<IndexedRecord> readSliceWithFilter(Predicate predicate,
baseFileReaders,
fileGroupReaderProps);
- HoodieFileGroupReader<IndexedRecord> fileGroupReader = HoodieFileGroupReader.<IndexedRecord>builder()
- .withReaderContext(readerContext)
- .withHoodieTableMetaClient(metadataMetaClient)
- .withLatestCommitTime(latestMetadataInstantTime)
- .withBaseFileOption(fileSlice.getBaseFile())
- .withLogFiles(fileSlice.getLogFiles())
- .withPartitionPath(fileSlice.getPartitionPath())
- .withDataSchema(SCHEMA)
- .withRequestedSchema(SCHEMA)
- .withProps(fileGroupReaderProps)
- .withRecordBufferLoader(recordBufferLoader)
- .build();
-
- return fileGroupReader.getClosableIterator();
+ if (useLsmReader) {
+ return HoodieLsmFileGroupReader.<IndexedRecord>builder()
Review Comment:
🤖 The classic reader filters MDT log blocks by the EXACT_MATCH valid-instant range (BaseHoodieLogRecordReader#isInRange), but HoodieLsmFileGroupReader only applies getInstantRange() to the base file — its native-log iterators read every log file unconditionally. Since the file slice from getPartitionLatestMergedFileSlices isn't pre-filtered, could this surface metadata for instants that completed on the MDT but aren't yet committed (or were rolled back) on the data table? @danny0405 should the native logs be filtered by delta-commit time against the valid instants here?
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag quality.</i></sub>
##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -606,20 +609,39 @@ private ClosableIterator<IndexedRecord> readSliceWithFilter(Predicate predicate,
baseFileReaders,
fileGroupReaderProps);
- HoodieFileGroupReader<IndexedRecord> fileGroupReader = HoodieFileGroupReader.<IndexedRecord>builder()
- .withReaderContext(readerContext)
- .withHoodieTableMetaClient(metadataMetaClient)
- .withLatestCommitTime(latestMetadataInstantTime)
- .withBaseFileOption(fileSlice.getBaseFile())
- .withLogFiles(fileSlice.getLogFiles())
- .withPartitionPath(fileSlice.getPartitionPath())
- .withDataSchema(SCHEMA)
- .withRequestedSchema(SCHEMA)
- .withProps(fileGroupReaderProps)
- .withRecordBufferLoader(recordBufferLoader)
- .build();
-
- return fileGroupReader.getClosableIterator();
+ if (useLsmReader) {
+ return HoodieLsmFileGroupReader.<IndexedRecord>builder()
+ .withReaderContext(readerContext)
+ .withHoodieTableMetaClient(metadataMetaClient)
+ .withLatestCommitTime(latestMetadataInstantTime)
+ .withBaseFileOption(fileSlice.getBaseFile())
+ .withLogFiles(fileSlice.getLogFiles())
+ .withPartitionPath(fileSlice.getPartitionPath())
+ .withDataSchema(SCHEMA)
+ .withRequestedSchema(SCHEMA)
+ .withProps(fileGroupReaderProps)
+ .build()
+ .getClosableIterator();
+ } else {
+ return HoodieFileGroupReader.<IndexedRecord>builder()
Review Comment:
🤖 nit: the two builder chains share 8 identical `.with*()` calls and differ only in `withRecordBufferLoader`. Could you check whether passing `null` to `withRecordBufferLoader` is a no-op in `HoodieFileGroupReader`? If so, a single builder with `withRecordBufferLoader(useLsmReader ? null : recordBufferLoader)` (and a type switch via an interface/factory) would avoid two places to update if the shared params ever change.
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag quality.</i></sub>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "cshuo (via GitHub)" <gi...@apache.org>.
cshuo commented on code in PR #19373:
URL: https://github.com/apache/hudi/pull/19373#discussion_r3654035802
##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -563,10 +565,12 @@ private ClosableIterator<IndexedRecord> readSliceWithFilter(Predicate predicate,
.rangeType(InstantRange.RangeType.EXACT_MATCH)
.explicitInstants(validInstantTimestamps).build());
+ boolean useLsmReader = shouldUseLsmReader(metadataMetaClient, fileSlice);
+
// If reuse is enabled and full scan is allowed for the partition, we can reuse the file readers for base files and the reader context for the log files.
Map<StoragePath, HoodieAvroFileReader> baseFileReaders = Collections.emptyMap();
ReusableFileGroupRecordBufferLoader<IndexedRecord> recordBufferLoader = null;
- boolean shouldReuse = reuse && isFullScanAllowedForPartition(fileSlice.getPartitionPath());
+ boolean shouldReuse = !useLsmReader && reuse && isFullScanAllowedForPartition(fileSlice.getPartitionPath());
Review Comment:
Yes, agreed. Reuse is primarily intended for small FILES partitions, the most frequent MDT lookup path. The LSM reader mainly benefits from exploiting sorted runs to avoid buffering intermediate records, so it doesn't have a clear advantage in this reused buffer scenario.
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 commented on code in PR #19373:
URL: https://github.com/apache/hudi/pull/19373#discussion_r3644992122
##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -563,10 +565,12 @@ private ClosableIterator<IndexedRecord> readSliceWithFilter(Predicate predicate,
.rangeType(InstantRange.RangeType.EXACT_MATCH)
.explicitInstants(validInstantTimestamps).build());
+ boolean useLsmReader = shouldUseLsmReader(metadataMetaClient, fileSlice);
+
// If reuse is enabled and full scan is allowed for the partition, we can reuse the file readers for base files and the reader context for the log files.
Map<StoragePath, HoodieAvroFileReader> baseFileReaders = Collections.emptyMap();
ReusableFileGroupRecordBufferLoader<IndexedRecord> recordBufferLoader = null;
- boolean shouldReuse = reuse && isFullScanAllowedForPartition(fileSlice.getPartitionPath());
+ boolean shouldReuse = !useLsmReader && reuse && isFullScanAllowedForPartition(fileSlice.getPartitionPath());
Review Comment:
if reuse is true, should we just use the spillable map based reader for the gains of cached log entries
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5067920565
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 5691ca3446f8db4c282da45566cf29945c844a68 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5067960780
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 5691ca3446f8db4c282da45566cf29945c844a68 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5086797985
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
}, {
"hash" : "80973325815a50b3988d464c81cde7d58740b0fb",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695",
"triggerID" : "80973325815a50b3988d464c81cde7d58740b0fb",
"triggerType" : "PUSH"
}, {
"hash" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 80973325815a50b3988d464c81cde7d58740b0fb Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695)
* e70f80066898c8bef21642a5c01e7884fa62efbd UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5087151407
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
}, {
"hash" : "80973325815a50b3988d464c81cde7d58740b0fb",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695",
"triggerID" : "80973325815a50b3988d464c81cde7d58740b0fb",
"triggerType" : "PUSH"
}, {
"hash" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15720",
"triggerID" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"triggerType" : "PUSH"
}, {
"hash" : "32f08444569e728f91b9cd17f05c52441e2a3489",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "32f08444569e728f91b9cd17f05c52441e2a3489",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 80973325815a50b3988d464c81cde7d58740b0fb Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695)
* e70f80066898c8bef21642a5c01e7884fa62efbd Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15720)
* 32f08444569e728f91b9cd17f05c52441e2a3489 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(flink): enable LSM reader for Flink metadata table [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19373:
URL: https://github.com/apache/hudi/pull/19373#issuecomment-5087295967
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "5691ca3446f8db4c282da45566cf29945c844a68",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15689",
"triggerID" : "5691ca3446f8db4c282da45566cf29945c844a68",
"triggerType" : "PUSH"
}, {
"hash" : "80973325815a50b3988d464c81cde7d58740b0fb",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15695",
"triggerID" : "80973325815a50b3988d464c81cde7d58740b0fb",
"triggerType" : "PUSH"
}, {
"hash" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15720",
"triggerID" : "e70f80066898c8bef21642a5c01e7884fa62efbd",
"triggerType" : "PUSH"
}, {
"hash" : "32f08444569e728f91b9cd17f05c52441e2a3489",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15721",
"triggerID" : "32f08444569e728f91b9cd17f05c52441e2a3489",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* e70f80066898c8bef21642a5c01e7884fa62efbd Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15720)
* 32f08444569e728f91b9cd17f05c52441e2a3489 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15721)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org