Davis-Zhang-Onehouse opened a new pull request, #20791:
URL: https://github.com/apache/hudi/pull/20791
### Describe the issue this Pull Request addresses
issue: #20790
Part of #20683, RFC-118 (#20684).
Stacked on #20789: review only the last commit. Until the PRs below it
merge, this PR also shows their commits.
A long-running ingestion round can move its instant to INFLIGHT before it
knows which files it writes. `PreferWriterConflictResolutionStrategy` with
`hoodie.clustering.fail.on.pending.ingestion.during.conflict.resolution` blocks
clustering only on `.requested` ingestion instants, so such an inflight
instant, which names no file group yet, does not block a clustering that may
rewrite the files it is about to write.
A Parquet writer of large binary values (inline blobs) also needs per-column
control that `HoodieBaseParquetWriter` does not offer: column statistics keep a
full copy of the min and max of each finished row group until the file closes,
a dictionary adds nothing for values that never repeat, and the default page
and file size check cadence lets pages and files grow well past their targets
when rows are large.
### Summary and Changelog
Clustering waits for marked long-running ingestion rounds, and a Parquet
writer can bound the memory and page size of large binary columns per column.
- `ConcurrentOperation.WORKLOAD_PROFILE_PENDING_KEY`
(`hoodie.write.workload.profile.pending`) is an extra-metadata key a writer
sets on the inflight commit metadata when it moves its instant to INFLIGHT
before the write has a workload profile;
`ConcurrentOperation.pendingWorkloadProfileMetadata(WriteOperationType)` builds
that metadata, and `isWorkloadProfilePending()` reads it.
- `PreferWriterConflictResolutionStrategy` treats a marked INFLIGHT
ingestion instant that names no file groups and whose writer heartbeat is
active like a `.requested` one when clustering blocks on pending ingestion. Any
other inflight instant, including an unmarked empty one, is resolved by the
file groups it names. The documentation of
`hoodie.clustering.fail.on.pending.ingestion.during.conflict.resolution` in
`HoodieWriteConfig` describes this.
- `HoodieBaseParquetWriter` reads these Hadoop configuration keys, set by a
writer that needs them (for example through a Parquet config injector);
Parquet's own generic keys are not read:
- `hoodie.parquet.internal.column.dictionary.enabled#<column>`: writes
that column without a dictionary.
- `hoodie.parquet.internal.column.statistics.enabled#<column>`: turns that
column's statistics off on Parquet 1.15 or later; on an older Parquet a `false`
value is refused with `HoodieNotSupportedException`
(`supportsColumnStatisticsSwitch()` reports which applies).
- `hoodie.parquet.internal.page.size.row.check.min` / `.max`: the row
counts between page size checks (Parquet 1.12.3 or later; skipped with a
one-time warning otherwise).
- `hoodie.parquet.internal.size.check.every.record`: `canWrite()` checks
the file size on every record.
- `canWrite()` always admits the first row of an empty file.
- Tests: `TestHoodieBaseParquetWriterPageBounds`, new cases in
`TestPreferWriterConflictResolutionStrategy` (marked inflight with active and
expired heartbeat, unmarked empty inflight, inflight with a workload profile),
and `TestHoodieClientOnCopyOnWriteStorage`.
Existing files touched: `ConcurrentOperation.java`,
`PreferWriterConflictResolutionStrategy.java`, `HoodieWriteConfig.java`,
`HoodieBaseParquetWriter.java`, and tests
`TestPreferWriterConflictResolutionStrategy.java`,
`TestHoodieClientOnCopyOnWriteStorage.java`.
No code was copied from other projects. 3 test files.
### Impact
Adds public constants and methods on `ConcurrentOperation` and
`HoodieBaseParquetWriter`. Writers that do not set the marker or the
`hoodie.parquet.internal.*` keys are unchanged: their inflight instants resolve
by file groups, and their Parquet files use the file's dictionary setting,
statistics and Parquet's default check cadence.
### Risk Level
medium: the change touches clustering conflict resolution and the Parquet
writer builder. Covered by `TestHoodieBaseParquetWriterPageBounds`,
`TestPreferWriterConflictResolutionStrategy` and
`TestHoodieClientOnCopyOnWriteStorage`; module compile, checkstyle and RAT on
JDK 11 / Spark 3.5 / Scala 2.12; GitHub Java CI runs on the stack tip.
### Documentation Update
The config documentation of
`hoodie.clustering.fail.on.pending.ingestion.during.conflict.resolution` is
updated in the diff. The `hoodie.parquet.internal.*` keys and the marker key
are documented in their Javadoc; they are not user configs.
### Contributor's checklist
- [x] 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]