bigquery: max staleness cannot be retreived/updated #10026
Labels
api: bigquery
Issues related to the BigQuery API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Client
https://pkg.go.dev/cloud.google.com/go/[email protected]
Code
e.g.
Expected behavior
When run against a MV that has
max_staleness
set, the code should:0-0 0 0:30:0
)0-0 0 5:0:0
Actual behavior
The code:
<nil>
as the current value ofMaxStaleness
(the actual value, set via SQL, is visible in BQ Studio)Additional context
By inspecting the client code, I've observed that the Table returned by the v2 API does return the current max staleness in the root
Table.maxStaleness
field. However, the client usesTable.materializedView.maxStaleness
, which is always empty in the server response.When it comes to writing, I couldn't get the BigQuery API to change the existing max staleness value. Setting
Table.maxStaleness
explicitly (instead ofTable.materializedView.maxStaleness
) in the client library did not work.By the way, the CDC feature has its own max staleness setting (which applies to tables, not MVs), so I wonder if these two are conflated somewhere in the API/client.
Relevant PR by @alvarowolfx (introduces max staleness to the client).
The text was updated successfully, but these errors were encountered: