google-bigquery - 外部表定义中的 skipLeadingRows=1
问题描述
在下面的示例中,如何设置跳过前导行选项?
bq --location=US query --external_table_definition=sales::Region:STRING,Quarter:STRING,Total_sales:INTEGER@CSV=gs://mybucket/sales.csv 'SELECT Region,Total_sales FROM sales;'
问候, 斯里坎特
解决方案
可以在安装主文件夹下找到标志选项(我在您要查找的标志下方以粗体标记)
/google-cloud-sdk/platform/bq/bq.py:
--[no]allow_jagged_rows: Whether to allow missing trailing optional columns in
CSV import data.
--[no]allow_quoted_newlines: Whether to allow quoted newlines in CSV import
data.
-E,--encoding: : The character encoding used by the input
file. Options include:
ISO-8859-1 (also known as Latin-1)
UTF-8
-F,--field_delimiter: The character that indicates the boundary between
columns in the input file. "\t" and "tab" are accepted names for tab.
--[no]ignore_unknown_values: Whether to allow and ignore extra, unrecognized
values in CSV or JSON import data.
--max_bad_records: Maximum number of bad records allowed before the entire job
fails.
(default: '0')
(an integer)
--quote: Quote character to use to enclose records. Default is ". To indicate
no quote character at all, use an empty string.
--[no]replace: If true erase existing contents before loading new data.
(default: 'false')
--schema: Either a filename or a comma-separated list of fields in the form
name[:type].
--skip_leading_rows: The number of rows at the beginning of the source file to
skip.
(an integer)
--source_format: : Format of
source data. Options include:
CSV
NEWLINE_DELIMITED_JSON
DATASTORE_BACKUP
推荐阅读
- kubernetes - 具有旧 ServiceAccountName 的 EKS StartupProbe 上的 Kubernetes 1.18
- javascript - 如何在 MSAL 的 redirectUri 中使用相对 url?
- c# - 使用反射将属性动态转换为实际类型(其中实际类型是通用的)v3
- less - 在 LESS 中使用 BEM,例如使用父母的 SASS
- node.js - Firebase 云消息传递未在 iOS 14 上提供推送通知
- python - 使用python进行平衡采样
- django - Django 按外键字段值分组对象
- cypress - MSAL 和 OAuth 2.0 - 以编程方式请求授权代码
- bash - 列出不是符号链接目标的目录
- php - 在 foreach 中对结果进行排序