google-bigquery Error while specifying pipe delimi

2019-08-15 04:38发布

问题:

I am trying to load a PIPE delimited file and running bq load command from windows platform. It is not accepting pipe delimiter in the command.

E.g. I am trying to use -F operator to specify the delimiter and could specify space delimiter but it stops working when I specify pipe delimiter.

C:\Windows>bq load -F" " "cmdwh_bq_prod.testtabPIPE"  "c:\temp\testPIPE.txt" PlatformVersion:int64,AnalyticsSessionID:int64,OutletGroup:string
Upload complete.
..... rest of the processing......
..... rest of the processing......

But same command stops working when I specify pipe delimiter...

C:\Windows>bq load -F"|" "cmdwh_bq_prod.testtabPIPE"  "c:\temp\testPIPE.txt" PlatformVersion:int64,AnalyticsSessionID:int64,OutletGroup:string
The filename, directory name, or volume label syntax is incorrect.

C:\Windows>

Please suggest.

回答1:

Found the solution. Caret(^) is the answer. Just put a caret right before pipe operator on command prompt and it will work.

C:\Users\adm_ratneshs>bq load -F"^|" cmdwh_bq_prod.testtabPIPE  e:\ETL\Data\BigQuery\Out\testPIPE.txt PlatformVersion:int64,AnalyticsSessionID:int64,OutletGroup:string
Upload complete.
Waiting on bqjob_r422161ad_00000162dbcd5ce2_1 ... (1s) Current status: DONE

C:\Users\adm_ratneshs>