【问题标题】:Google Big Query- Create Table Schema by CommandLineGoogle Big Query - 通过命令行创建表架构
【发布时间】:2018-01-05 09:47:02
【问题描述】:

我正在尝试通过 BigQuery 中的命令行手动创建表架构

参考-https://cloud.google.com/bigquery/docs/schemas#specify-schema-manual-cli

我的命令

bq load --source_format=CSV EncoreMarketingTest.SchemaTest1231 D:/myfile1.csv qtr:STRING,sales:FLOAT,year:STRING

它给出以下错误,但如果我只传递一个参数,那么它工作正常:

错误:

 Upload complete.
Waiting on bqjob_r1d79e443_00000160c5b1e5d3_1 ... (0s) Current status: DONE
BigQuery error in load operation: Error processing job
'encoremarketingtest:bqjob_r1d79e443_00000160c5b1e5d3_1': Error while reading
data, error message: CSV table encountered too many errors, giving up. Rows: 1;
errors: 1.
Failure details:
- file-00000000: Error while reading data, error message: CSV table
references column position 1, but line starting at position:0
contains only 1 columns.

能否请您告诉我命令中的问题?

【问题讨论】:

  • 您可以分享文件的前 2 行吗?
  • 你指向 myfile1.csv 吗?该文件为空
  • 是的。为什么是空的?您正在尝试加载包含一些数据的文件,对吗?或者,您只是想创建一个空表? “它给出了以下错误,但如果我只传递一个参数,那么它工作正常:” - 你是什么意思? bq load 用于加载文件/数据。

标签: google-bigquery


【解决方案1】:

您的问题让我有些困惑,但我假设您正在尝试创建一个空表,而不是尝试加载文件/数据。

您正在使用bq load。你应该使用bq mk,例如:

bq mk --schema name:string,value:integer -t mydataset.newtable

查看更多信息here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多