【问题标题】:google-bigquery Error while specifying pipe delimiter in bq load command on windows在 Windows 上的 bq load 命令中指定管道分隔符时出现 google-bigquery 错误
【发布时间】:2018-04-19 01:41:24
【问题描述】:

我正在尝试从 Windows 平台加载 PIPE 分隔文件并运行 bq load 命令。它不接受命令中的管道分隔符。

例如我正在尝试使用 -F 运算符来指定分隔符,并且可以指定空格分隔符,但是当我指定管道分隔符时它停止工作。

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......

但是当我指定管道分隔符时,相同的命令停止工作......

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>

请提出建议。

【问题讨论】:

    标签: windows google-bigquery pipe delimiter


    【解决方案1】:

    这对我有用:

    bq 加载 --source_format=CSV --field_delimiter="|" dataset.tablename gs://bucket/foldername/filename.txt ./myschema.json

    【讨论】:

    • 那行得通..但我正在尝试使用 python 和 subprocess 命令,由于某种原因,它添加了另一个“”,所以它不起作用。
    【解决方案2】:

    找到了解决办法。 Caret(^) 就是答案。只需在命令提示符下的管道运算符之前放置一个插入符号,它就会起作用。

    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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-21
      • 2021-04-05
      • 1970-01-01
      • 1970-01-01
      • 2019-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多