Expand description
Type-aware conversion from BigQuery TableRows to JSON objects.
BigQuery returns every scalar cell as a string regardless of declared
type, with non-trivial structure (RECORD/STRUCT/REPEATED) reflected
in nested cell shapes:
- A
RECORDcell carries{"f": [...nested cells...]}in itsvaluefield. - A
REPEATEDcell carries[{"v": ...cell...}, ...]in itsvaluefield — one element per array entry.
This module walks the schema in lockstep with each row’s cells and emits
a serde_json::Value::Object keyed by column name, with each cell typed
according to its TableFieldSchema.
§Type mapping
| BigQuery type | JSON output |
|---|---|
INTEGER / INT64 | Number (i64 if it fits, else f64) |
FLOAT / FLOAT64 | Number (f64) |
NUMERIC / BIGNUMERIC | String (full precision preserved) |
BOOLEAN / BOOL | Bool |
RECORD / STRUCT | nested Object |
REPEATED <T> mode | Array<T> |
JSON | parsed Value (falls back to String) |
STRING / BYTES / TIMESTAMP / DATE / TIME / DATETIME / GEOGRAPHY / INTERVAL | String |
NULL cell | Null |
Functions§
- row_
to_ json - Convert a BigQuery
TableRowinto a JSON object using its schema.