zhuanshenbsj1 opened a new pull request, #10606:
URL: https://github.com/apache/paimon/pull/10606

   ### Purpose
   
       Currently, when constructing a `BlobView` / `BlobViewStruct` via the 
Java Core API (`Blob.fromView(new BlobViewStruct(identifier, fieldId, 
rowId))`), callers must manually look up the upstream column's internal schema
     `fieldId` (e.g., `upstreamTable.rowType().getField("picture").id()`). 
Meanwhile, Flink (`BlobViewFunction`) and Spark (`ReplacePaimonFunctions`) 
duplicate the same field-name lookup and `BLOB` type validation logic.
   
       This PR improves usability and code reuse by:
       1. Adding `BlobViewStruct.resolveBlobFieldId(Identifier, RowType, 
String)` and `BlobViewStruct.of(Identifier, RowType, String, long)` in 
`paimon-common`.
       2. Adding convenience factory overloads `Blob.fromView(Identifier, int, 
long)` and `Blob.fromView(Identifier, RowType, String, long)` in `Blob`.
       3. Deduplicating the field resolution and `BLOB` type validation in 
Flink `BlobViewFunction` and Spark `ReplacePaimonFunctions` to reuse 
`BlobViewStruct.resolveBlobFieldId`.
       4. Simplifying manual `fieldId` lookups across existing tests 
(`BlobTableTest`, `PrimaryKeyPartialUpdateBlobTest`, `RESTCatalogTest`).
   
       ### Tests
   
       - `BlobViewStructTest#testConstructByFieldName`
       - Existing tests in `BlobTableTest`, `PrimaryKeyPartialUpdateBlobTest`, 
and `RESTCatalogTest`
       - Passed `spotless:check` and `checkstyle:check`


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