Commit 7d16de8
authored
b/549680449
This PR exposes `StatementType` and jobless query execution metrics on
`TableResult` by plumbing them from `QueryResponse` and
`JobStatistics.QueryStatistics`.
This enables downstream consumers (such as the BigQuery JDBC driver) to
inspect query statement types and execution statistics directly from
`TableResult` without needing to issue secondary jobs or dry-run
queries.
## Changes
- **Dependency Update**: Bumped `google-api-services-bigquery` to
`v2-rev20260731-2.0.0` in `google-cloud-jar-parent/pom.xml` and
`java-bigquery/pom.xml`.
- **TableResult**: Added getters, builder setters, pagination
propagation (`getNextPage()`), `toString()`, `hashCode()`, and
`equals()` for:
- `getStatementType()` (`StatementType`)
- `getTotalBytesBilled()` (`Long`)
- `getTotalBytesProcessed()` (`Long`)
- `getTotalSlotMs()` (`Long`)
- `getNumDmlAffectedRows()` (`Long`)
- **BigQueryImpl**: Plumbed these fields from `QueryResponse` when
building `TableResult` in `queryRpc()`.
- **Job**: Plumbed `StatementType` and query metrics from
`QueryStatistics` when creating `TableResult` in `getQueryResults()`.
- **Tests**: Added unit tests in `TableResultTest` and
`BigQueryImplTest` verifying field retrieval, pagination propagation,
builder modifications, and serialization.
1 parent 0d5fac0 commit 7d16de8
6 files changed
Lines changed: 291 additions & 15 deletions
File tree
- java-bigquery
- google-cloud-bigquery/src
- main/java/com/google/cloud/bigquery
- test/java/com/google/cloud/bigquery
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
2095 | 2097 | | |
2096 | 2098 | | |
2097 | 2099 | | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
2098 | 2111 | | |
2099 | 2112 | | |
2100 | 2113 | | |
| |||
2114 | 2127 | | |
2115 | 2128 | | |
2116 | 2129 | | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
2117 | 2136 | | |
2118 | 2137 | | |
2119 | 2138 | | |
| |||
2134 | 2153 | | |
2135 | 2154 | | |
2136 | 2155 | | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
2137 | 2162 | | |
2138 | 2163 | | |
2139 | 2164 | | |
| |||
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
414 | 417 | | |
415 | 418 | | |
416 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
417 | 431 | | |
418 | 432 | | |
419 | 433 | | |
| |||
425 | 439 | | |
426 | 440 | | |
427 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
428 | 448 | | |
429 | 449 | | |
430 | 450 | | |
| |||
436 | 456 | | |
437 | 457 | | |
438 | 458 | | |
439 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
440 | 469 | | |
441 | 470 | | |
442 | 471 | | |
| |||
Lines changed: 94 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | | - | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
54 | 68 | | |
55 | 69 | | |
56 | 70 | | |
| |||
62 | 76 | | |
63 | 77 | | |
64 | 78 | | |
65 | | - | |
66 | | - | |
| 79 | + | |
67 | 80 | | |
68 | 81 | | |
69 | 82 | | |
| |||
74 | 87 | | |
75 | 88 | | |
76 | 89 | | |
77 | | - | |
78 | | - | |
| 90 | + | |
79 | 91 | | |
80 | | - | |
81 | | - | |
| 92 | + | |
82 | 93 | | |
83 | | - | |
84 | | - | |
| 94 | + | |
85 | 95 | | |
86 | 96 | | |
87 | | - | |
88 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
89 | 142 | | |
90 | 143 | | |
91 | 144 | | |
| |||
109 | 162 | | |
110 | 163 | | |
111 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
112 | 171 | | |
113 | 172 | | |
114 | 173 | | |
| |||
147 | 206 | | |
148 | 207 | | |
149 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
150 | 215 | | |
151 | 216 | | |
152 | 217 | | |
153 | 218 | | |
154 | 219 | | |
155 | 220 | | |
156 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
157 | 232 | | |
158 | 233 | | |
159 | 234 | | |
| |||
170 | 245 | | |
171 | 246 | | |
172 | 247 | | |
173 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
174 | 255 | | |
175 | 256 | | |
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| 174 | + | |
| 175 | + | |
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
| |||
2874 | 2878 | | |
2875 | 2879 | | |
2876 | 2880 | | |
| 2881 | + | |
| 2882 | + | |
2877 | 2883 | | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
2878 | 2887 | | |
2879 | 2888 | | |
2880 | 2889 | | |
| |||
2883 | 2892 | | |
2884 | 2893 | | |
2885 | 2894 | | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
2886 | 2903 | | |
2887 | 2904 | | |
2888 | 2905 | | |
| |||
0 commit comments