BigQuery 下载或导出为 JSON 不尊重类型 [英] BigQuery downloading or exporting as JSON does not respect types
本文介绍了BigQuery 下载或导出为 JSON 不尊重类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 BigQuery 中运行的查询:
Query I run in BigQuery:
SELECT 5 as a
运行上述查询并选择另存为表时得到的架构:
Schema I get when I run the above query and select Save as Table:
当我将查询结果下载为 JSON 时得到的 JSON 或当我导出表时:
JSON I get when I download the query result as JSON or when I export the table:
{"a":"5"}
这不应该是:
{"a":5}
推荐答案
来自 导出表数据 - 导出限制:
以 JSON 格式导出数据时,INT64(整数)数据类型为编码为 JSON 字符串以保留 64 位精度被其他系统读取.
When you export data in JSON format, INT64 (integer) data types are encoded as JSON strings to preserve 64-bit precision when the data is read by other systems.
这篇关于BigQuery 下载或导出为 JSON 不尊重类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文