在尝试将此JSON导入到Google BigQuery表时,我遇到了以下错误:
file-00000000: JSON表格遇到太多错误,放弃。行数:1;错误数:1。(错误代码:无效)
文件file-00000000中的行以位置0开始的JSON解析错误。在没有对象开始的情况下遇到数组的开头。(错误代码:无效)
这是JSON内容:
[{'instrument_token': 11192834, 'average_price': 8463.45, 'last_price': 8471.1, 'last_quantity': 75, 'buy_quantity': 1065150, 'volume': 5545950, 'depth': {'buy': [{'price': 8471.1, 'quantity': 300, 'orders': 131072}, {'price': 8471.0, 'quantity': 300, 'orders': 65536}, {'price': 8470.95, 'quantity': 150, 'orders': 65536}, {'price': 8470.85, 'quantity': 75, 'orders': 65536}, {'price': 8470.7, 'quantity': 225, 'orders': 65536}], 'sell': [{'price': 8471.5, 'quantity': 150, 'orders': 131072}, {'price': 8471.55, 'quantity': 375, 'orders': 327680}, {'price': 8471.8, 'quantity': 1050, 'orders': 65536}, {'price': 8472.0, 'quantity': 1050, 'orders': 327680}, {'price': 8472.1, 'quantity': 150, 'orders': 65536}]}, 'ohlc': {'high': 8484.1, 'close': 8336.45, 'low': 8422.35, 'open': 8432.75}, 'mode': 'quote', 'sell_quantity': 998475, 'tradeable': True, 'change': 1.6151959167271395}]
http://jsonformatter.org/ 也会对这个 JSON 块进行解析错误。需要帮助理解格式有何问题——这是一个来自 Rest API 的 JSON。
ndjson
并上传。它可以工作!您可以使用在线工具将json转换为ndjson。 - Avinash