2017-07-26 31 views
0

我试图从云存储中加载数据到一个表中,并获取下面的错误消息。BQ负载,我得到“太多的位置参数 - 仍然有[...”

bq load --skip_leading_rows=1 --field_delimiter='\t' --source_format=CSV projectID:dataset.table gs://bucket/source.txt sku:STRING,variant_id:STRING,title:STRING,category:STRING,description:STRING,buy_url:STRING,mobile_url:STRING,itemset_url:STRING,image_url:STRING,swatch_url:STRING,availability:STRING,issellableonline:STRING,iswebexclusive:STRING,price:STRING,saleprice:STRING,quantity:STRING,coresku_inet:STRING,condition:STRING,productreviewsavg:STRING,productreviewscount:STRING,mediaset:STRING,webindexpty:INTEGER,NormalSalesIndex1:FLOAT,NormalSalesIndex2:FLOAT,NormalSalesIndex3:FLOAT,SalesScore:FLOAT,NormalInventoryIndex1:FLOAT,NormalInventoryIndex2:FLOAT,NormalInventoryIndex3:FLOAT,InventoryScore:FLOAT,finalscore:FLOAT,EDVP:STRING,dropship:STRING,brand:STRING,model_number:STRING,gtin:STRING,color:STRING,size:STRING,gender:STRING,age:STRING,oversized:STRING,ishazardous:STRING,proddept:STRING,prodsubdept:STRING,prodclass:STRING,prodsubclass:STRING,sku_attr_names:STRING,sku_attr_values:STRING,store_id:STRING,store_quantity:STRING,promo_name:STRING,product_badge:STRING,cbl_type_names1:STRING,cbl_type_value1:STRING,cbl_type_names2:STRING,cbl_type_value2:STRING,cbl_type_names3:STRING,cbl_type_value3:STRING,cbl_type_names4:STRING,cbl_type_value4:STRING,cbl_type_names5:STRING,cbl_type_value5:STRING,choice1_name_value:STRING,choice2_name_value:STRING,choice3_name_value:STRING,cbl_is_free_shipping:STRING,isnewflag:STRING,shipping_weight:STRING,masterpath:STRING,accessoriesFlag:STRING,short_copy:STRING,bullet_copy:STRING,map:STRING,display_msrp:STRING,display_price:STRING,suppress_sales_display:STRING,margin:FLOAT 

我也试图加载模式到一个json文件,我得到相同的错误信息。

+0

你运行什么命令来使用JSON文件中的模式?你可以发布架构JSON文件的内容吗?你有一个最小的示例CSV文件,仍然显示此错误? –

+1

看起来您在命令行上有两个“加载”参数。 – cherba

+0

要加载JSON,我会使用此脚本 BQ负载--skip_leading_rows = 1 --field_delimiter = '\ T' --source_format = CSV负载专案编号:dataset.table GS://bucket/source.txt架构。 JSON – csjohnstone

回答

0

由于这是太大的评论,将张贴在这里。

我不知道你设置的模式文件有这样的内容发生了什么:如果你将它保存在文件“schema.json”说和运行命令

[{"name": "sku", "type": "STRING"}, 
{"name": "variant_id", "type": "STRING"}, 
{"name": "title", "type": "STRING"}, 
{"name": "category", "type": "STRING"}, 
{"name": "description", "type": "STRING"}, 
{"name": "buy_url", "type": "STRING"}, 
{"name": "mobile_url", "type": "STRING"}, 
{"name": "itemset_url", "type": "STRING"}, 
{"name": "image_url", "type": "STRING"}, 
{"name": "swatch_url", "type": "STRING"}, 
{"name": "availability", "type": "STRING"}, 
{"name": "issellableonline", "type": "STRING"}, 
{"name": "iswebexclusive", "type": "STRING"}, 
{"name": "price", "type": "STRING"}, 
{"name": "saleprice", "type": "STRING"}, 
{"name": "quantity", "type": "STRING"}, 
{"name": "coresku_inet", "type": "STRING"}, 
{"name": "condition", "type": "STRING"}, 
{"name": "productreviewsavg", "type": "STRING"}, 
{"name": "productreviewscount", "type": "STRING"}, 
{"name": "mediaset", "type": "STRING"}, 
{"name": "webindexpty", "type": "INTEGER"}, 
{"name": "NormalSalesIndex1", "type": "FLOAT"}, 
{"name": "NormalSalesIndex2", "type": "FLOAT"}, 
{"name": "NormalSalesIndex3", "type": "FLOAT"}, 
{"name": "SalesScore", "type": "FLOAT"}, 
{"name": "NormalInventoryIndex1", "type": "FLOAT"}, 
{"name": "NormalInventoryIndex2", "type": "FLOAT"}, 
{"name": "NormalInventoryIndex3", "type": "FLOAT"}, 
{"name": "InventoryScore", "type": "FLOAT"}, 
{"name": "finalscore", "type": "FLOAT"}, 
{"name": "EDVP", "type": "STRING"}, 
{"name": "dropship", "type": "STRING"}, 
{"name": "brand", "type": "STRING"}, 
{"name": "model_number", "type": "STRING"}, 
{"name": "gtin", "type": "STRING"}, 
{"name": "color", "type": "STRING"}, 
{"name": "size", "type": "STRING"}, 
{"name": "gender", "type": "STRING"}, 
{"name": "age", "type": "STRING"}, 
{"name": "oversized", "type": "STRING"}, 
{"name": "ishazardous", "type": "STRING"}, 
{"name": "proddept", "type": "STRING"}, 
{"name": "prodsubdept", "type": "STRING"}, 
{"name": "prodclass", "type": "STRING"}, 
{"name": "prodsubclass", "type": "STRING"}, 
{"name": "sku_attr_names", "type": "STRING"}, 
{"name": "sku_attr_values", "type": "STRING"}, 
{"name": "store_id", "type": "STRING"}, 
{"name": "store_quantity", "type": "STRING"}, 
{"name": "promo_name", "type": "STRING"}, 
{"name": "product_badge", "type": "STRING"}, 
{"name": "cbl_type_names1", "type": "STRING"}, 
{"name": "cbl_type_value1", "type": "STRING"}, 
{"name": "cbl_type_names2", "type": "STRING"}, 
{"name": "cbl_type_value2", "type": "STRING"}, 
{"name": "cbl_type_names3", "type": "STRING"}, 
{"name": "cbl_type_value3", "type": "STRING"}, 
{"name": "cbl_type_names4", "type": "STRING"}, 
{"name": "cbl_type_value4", "type": "STRING"}, 
{"name": "cbl_type_names5", "type": "STRING"}, 
{"name": "cbl_type_value5", "type": "STRING"}, 
{"name": "choice1_name_value", "type": "STRING"}, 
{"name": "choice2_name_value", "type": "STRING"}, 
{"name": "choice3_name_value", "type": "STRING"}, 
{"name": "cbl_is_free_shipping", "type": "STRING"}, 
{"name": "isnewflag", "type": "STRING"}, 
{"name": "shipping_weight", "type": "STRING"}, 
{"name": "masterpath", "type": "STRING"}, 
{"name": "accessoriesFlag", "type": "STRING"}, 
{"name": "short_copy", "type": "STRING"}, 
{"name": "bullet_copy", "type": "STRING"}, 
{"name": "map", "type": "STRING"}, 
{"name": "display_msrp", "type": "STRING"}, 
{"name": "display_price", "type": "STRING"}, 
{"name": "suppress_sales_display", "type": "STRING"}, 
{"name": "margin", "type": "FLOAT"}] 

bq load --skip_leading_rows=1 --field_delimiter='\t' --source_format=CSV projectID:dataset.table gs://bucket/source.txt schema.json 

你仍然得到同样的错误?

0

切尔巴钉了它。错字是在我的批处理文件中,包含额外的负载参数。感谢您的全力考虑。

相关问题