1

我有一个 JSON 模式:

[{"name":"timestamp","type":"integer"},{"name":"xml_id","type":"string"},{"name":"prod","type": "string"},{"name":"version","type":"string"},{"name":"distcode","type":"string"},{"name":"origcode", "type":"string"},{"name":"overcode","type":"string"},{"name":"prevcode","type":"string"},{"name": "ie","type":"string"},{"name":"os","type":"string"},{"name":"payload","type":"string"},{ “名称”:“语言”,"type":"string"},{"name":"userid","type":"string"},{"name":"sysid","type":"string"},{"name": "loc","type":"string"},{"name":"impetus","type":"string"},{"name":"numprompts","type":"record","mode ":"repeated","fields":[{"name":"type","type":"string"},{"name":"count","type":"integer"}]},{ "name":"rcode","type":"record","mode":"repeated","fields":[{"name":"offer","type":"string"},{"name “:“代码”,”type":"integer"}]},{"name":"bw","type":"string"},{"name":"pkg_id","type":"string"},{"name" :"cpath","type":"string"},{"name":"rsrc","type":"string"},{"name":"pcode","type":"string"}, {"name":"opage","type":"string"},{"name":"action","type":"string"},{"name":"value","type":" string"},{"name":"other","type":"record","mode":"repeated","fields":[{"name":"param","type":"string" },{"名称":"值",“类型”:“字符串”}]}]

http://jsoneditoronline.org/用于漂亮的打印)

通过浏览器 GUI 加载时,模式被接受为有效。cli 抛出以下错误:

BigQuery error in load operation: Invalid schema entry: "fields":[{"name":"type"

我指定的架构有问题吗?

4

1 回答 1

1

如果您将架构作为 json 传递,则应将其写入文件并将文件名作为架构参数传递。在命令行上传递模式内联只允许用于简单的平面模式。

于 2012-10-22T23:20:25.373 回答