Davis-Zhang-Onehouse opened a new pull request, #20805:
URL: https://github.com/apache/hudi/pull/20805

   ### Describe the issue this Pull Request addresses
   
   issue: #20804
   Part of #20683, RFC-118 (#20684).
   Stacked on #20803: review only the last commit. Until the PRs below it 
merge, this PR also shows their commits.
   
   Failure classification across the unstructured ingestion code walks 
exception cause chains. A chain whose causes form a cycle must not loop 
forever, and the unstructured packages need one cycle-safe traversal in 
`hudi-common` that every caller shares. The compute retry loop needs the 
backoff schedule that `TransientRetry` computes, with its own cap.
   
   The embedding job's startup checks are split between the source and the 
transformer, and a configured partition path field is only checked against the 
fixed table columns, so a partition column that a transformer in the chain 
produces (or stops producing) is not planned at start.
   
   ### Summary and Changelog
   
   Cause-chain traversal is cycle-safe and shared, and the job plans partition 
columns from the columns its transformer chain produces before any data is 
written.
   
   - `ExceptionUtil` (`hudi-common`): `validateErrorMsg` and `isCausedBy` stop 
before a cause repeats; new `getCauses(Throwable)` (the chain in order, without 
suppressed exceptions) and `getRootCause(Throwable)`. Failure classification in 
the unstructured packages (source, prep, image, video, audio, PDF, Bedrock and 
Vertex, `BlobRowBuilder`, `StorageReferenceRules`) uses `ExceptionUtil`; the 
package-local `SourceCauses` helper is removed.
   - `TransientRetry`: a constructor with a caller-selected backoff cap and a 
public `waitBefore`; `MicroBatchEmbeddingIterator` uses it with compute's 
60-second cap.
   - `UnstructuredSchemaContract#checkChainPlan`: when a 
`hoodie.datasource.write.partitionpath.field` column (top-level or a 
dot-separated nested path) is not a fixed table column, it plans the columns 
the required transformer and the later chain entries produce, resolves 
duplicates as the closing guard does, and refuses a partition column the job 
does not produce. It reads the embedding round schema from 
`EmbeddingTableSchema#roundSchema`.
   - Startup checks: `EmbeddingTableConfig#activeModel` holds the 
single-active-model rule, and a model column must be a valid Avro field name. 
`EmbeddingTableTransformer#checkRound` runs the property checks for a source 
without a startup contract; `UnstructuredDataSource` skips its own property 
validation when the source contract already prepared the job.
   - `ErrorText` cuts text on a UTF-16 boundary with `Utf16.floor`; 
`EmbeddingTableConfig` reads positive long settings through 
`NumericConfig.positiveLong`.
   - Tests: `TestExceptionUtil` (cycles, order, null), 
`TestUnstructuredChainPlan`, `TestSourceObjectOpenerLifecycle`, 
`TestBlobBytesSourceStorageFailures`, `TestPrepRoundSourceObjects`, and 
additions to `TestTransientRetry`, `TestEmbeddingConfigRulings`, 
`TestEmbeddingSourceContract`, `TestEmbeddingUserPartitioning`, 
`TestEmbeddingModeConfig` and `TestVideoSpeechChunks`. 14 test files.
   
   Existing files touched: 
`hudi-common/src/main/java/org/apache/hudi/exception/ExceptionUtil.java`, 
`hudi-common/src/test/java/org/apache/hudi/exception/TestExceptionUtil.java`.
   
   No code was copied from other projects.
   
   ### Impact
   
   `ExceptionUtil` gains two public methods, and its cause walks end on a 
cyclic chain. An unstructured job whose partition path names a column its 
transformer chain does not produce, or whose model column is not a valid Avro 
field name, is refused at start with nothing written. Other behaviour is 
unchanged.
   
   ### Risk Level
   
   low: on an acyclic chain the shared traversal visits the same causes in the 
same order, and the new start-time refusals apply only to configurations that 
cannot be written.
   
   ### Documentation Update
   
   none
   
   ### 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]

Reply via email to