2017-07-26 61 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

切爾巴釘了它。錯字是在我的批處理文件中,包含額外的負載參數。感謝您的全力考慮。

相關問題