Repository navigation
Commit b25100d
authored
test(bigquery-jdbc): add picosecond timestamp integration tests (#14392)
b/556664087
This PR adds ITs and and fixes one gap the ITs uncovered.
## Production fix
`BigQueryConnection.getBigQueryConnection()` now sets
`DataFormatOptions.TimestampFormatOptions.ISO8601_STRING` when
`EnableTimestampPicos=1`.
The REST JSON read path was silently truncating to microseconds.
BigQuery
serializes `TIMESTAMP` as FLOAT64 epoch seconds by default, which cannot
represent sub-microsecond digits; `ISO8601_STRING` is the only output
format
that carries the full 12-digit fraction. The Arrow path was already
correct,
which is why unit tests and metadata assertions passed while REST values
did
not.
Gated on the property so the wire format is unchanged for existing
users.
## Tests
New `ITJdbcTimestampPicosTest` (11 tests): Arrow and REST read paths,
complex
types (`ARRAY`/`STRUCT`), `ResultSetMetaData`,
`DatabaseMetaData.getColumns`,
`PreparedStatement` round trips, Legacy SQL rejection, and timezone
invariance.
Registered in the presubmit, nightly, and driver-agnostic suites. Six
tests
carry `@Tag("advanced")` where behavior is driver-specific; the
remaining five
were verified to pass against other drivers.
## Known limitation
BigQuery truncates `TIMESTAMP`-typed query parameters to microseconds
even
against a `TIMESTAMP(12)` column (b/419328655), so
`setTimestamp`/`setObject`
cannot write picosecond values. `setString` works, since the value is
coerced
server side. Documented in `USER_GUIDE.md` and asserted in the tests so
the
expectations flip loudly when the backend fix lands.1 parent c1aac66 commit b25100d
8 files changed
Lines changed: 610 additions & 0 deletions
File tree
- java-bigquery-jdbc
- docs
- src
- main/java/com/google/cloud/bigquery/jdbc
- test/java/com/google/cloud/bigquery/jdbc
- it
- suites
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
216 | 232 | | |
217 | 233 | | |
218 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
1294 | 1295 | | |
1295 | 1296 | | |
1296 | 1297 | | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
1297 | 1308 | | |
1298 | 1309 | | |
1299 | 1310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
262 | 281 | | |
263 | 282 | | |
264 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
| |||
0 commit comments