hekk-kaori-maeda opened a new pull request, #36832:
URL: https://github.com/apache/beam/pull/36832
## What is the purpose of the change?
This change adds table identification capabilities to
`BigQueryStorageApiInsertError` to help users identify and troubleshoot errors
when using BigQuery Storage Write API,
especially in pipelines that write to multiple tables.
Fixes #36831
## What changes are included in this PR?
1. **Added `tableUrn` field to `BigQueryStorageApiInsertError`**
- Format: `projects/{project}/datasets/{dataset}/tables/{table}`
- Consistent with `TableDestination.getTableUrn()` format
2. **Added convenience methods with lazy initialization**
- `getProjectId()`, `getDatasetId()`, `getTableId()`
- Uses lazy initialization with caching for optimal performance
3. **Updated `BigQueryStorageApiInsertErrorCoder`**
- Encode/decode `tableUrn` field
4. **Updated all calling sites to pass `tableUrn`**
- `StorageApiWriteUnshardedRecords.java` (3 locations)
- `StorageApiWritesShardedRecords.java` (3 locations)
- `StorageApiConvertMessages.java` (2 locations)
This makes the API consistent with `BigQueryInsertError` (used by
STREAMING_INSERTS method).
## How was this change tested?
- ✅ Local unit tests: `./gradlew :sdks:java:io:google-cloud-platform:test
--tests "*StorageApi*"` (PASSED)
- ✅ Code formatting: `./gradlew
:sdks:java:io:google-cloud-platform:spotlessApply` (PASSED)
- ✅ Verified table information is correctly captured in production
pipeline error logs
## Was this change documented?
- [x] Code changes are self-documenting
- [ ] Javadoc updated (existing constructors and getters are
self-explanatory)
## Checklist
- [x] Mentions the appropriate issue: `Fixes #36831`
- [ ] Update `CHANGES.md` (will add if required by reviewers)
- [x] ICLA not required (small contribution)
--
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]