Commit f8e4de0
authored
Improve BigQueryIO Storage Write API error messages (#38948)
* Improve BigQueryIO Storage Write API error messages
* Surface the root cause in the RuntimeException when AppendRows retries are exhausted.
* Elevate the final failure logging to ERROR level.
* Provide actionable advice for PERMISSION_DENIED and NOT_FOUND errors, suggesting to check if the destination table exists and if the service account has the TABLES_UPDATE_DATA permission.
* Add a unit test to verify the improved error messages on retry exhaustion.
* Address PR feedback: Use null-safe == operator for enum comparison
* Address PR feedback: remove duplicate logging, simplify status extraction, and preserve exception chain
* Address PR feedback: handle InterruptedException properly and use official IAM permission name
* Address PR feedback: handle InterruptedException and use official permission name in source files
* Fix NotSerializableException: mark appendRowsError as transient in FakeDatasetService
* Fix NotSerializableException: store error as serializable Strings and reconstruct at runtime
The previous transient fix prevented the serialization error but caused
the error to be lost on deserialization, so the test never actually
triggered the error path. Instead, store the gRPC status code and
description as serializable Strings and reconstruct the
StatusRuntimeException at runtime in appendRows.
* Fix CI failure: create table in FakeDatasetService before pipeline run
The test was failing because no table was created in the fake dataset
service, causing createWriteStream to fail with NOT_FOUND before the
pipeline ever reached appendRows. Now we create the table first so the
pipeline reaches the appendRows call where the PERMISSION_DENIED error
is actually injected.
* Fix CI failure: remove withTriggeringFrequency for bounded PCollection
Parameterizations [3] and [4] (useStreaming=true) were failing because
withTriggeringFrequency requires an unbounded PCollection, but the test
uses Create.of which is bounded. Removed the withTriggeringFrequency
block since the Storage Write API is still exercised via useStorageApi.
* Fix CI failure: skip streaming parameterizations that cause timeout
Streaming parameterizations [3] and [4] (useStreaming=true) cause the
pipeline to hang indefinitely with a bounded PCollection, resulting in
a 600s timeout. The streaming path uses triggering frequency which
requires an unbounded source. Since the error handling code is identical
in both sharded and unsharded paths, testing the non-streaming path
(useStorageApi=true, useStreaming=false) is sufficient.1 parent db66869 commit f8e4de0
4 files changed
Lines changed: 110 additions & 3 deletions
File tree
- sdks/java/io/google-cloud-platform/src
- main/java/org/apache/beam/sdk/io/gcp
- bigquery
- testing
- test/java/org/apache/beam/sdk/io/gcp/bigquery
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
792 | 792 | | |
793 | 793 | | |
794 | 794 | | |
795 | | - | |
| 795 | + | |
796 | 796 | | |
797 | | - | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
798 | 806 | | |
799 | 807 | | |
800 | 808 | | |
| |||
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1066 | 1066 | | |
1067 | 1067 | | |
1068 | 1068 | | |
1069 | | - | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
1070 | 1088 | | |
1071 | 1089 | | |
1072 | 1090 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
241 | 251 | | |
242 | 252 | | |
243 | 253 | | |
| |||
801 | 811 | | |
802 | 812 | | |
803 | 813 | | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
804 | 822 | | |
805 | 823 | | |
806 | 824 | | |
| |||
Lines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1659 | 1659 | | |
1660 | 1660 | | |
1661 | 1661 | | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
1662 | 1725 | | |
1663 | 1726 | | |
1664 | 1727 | | |
| |||
0 commit comments