Har*_*ada 3 python mysql google-bigquery
我正在尝试在 google BigQuery 上的数据集中合并两个表
使用以下代码:
def mergeTables(workingTable, table, DATASET_ID):
query ="""
SELECT
full_name,
age
FROM {DATASET_ID}.{workingTable}
UNION DISTINCT
SELECT
full_name,
age
FROM {DATASET_ID}.{table}
LIMIT 100;
"""
df = pd.read_gbq(query, "joe-python-analytics", 'standard')
print(df)
Run Code Online (Sandbox Code Playgroud)
工作表和表是我希望与我的联合操作员合并的两个表。但是,当我运行该方法时,出现错误:
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/bigquery/v2/projects/j/queries/job_aalt=json returned "Encountered "" at line 6, column 15.
[Try using standard SQL (https://cloud.google.com/bigquery/docs/reference/standard-sql/enabling-standard-sql)]">
Run Code Online (Sandbox Code Playgroud)
我已经启用了标准 sql 这似乎没有帮助?
尝试使输入对 Python 显式,如下所示:
df = pd.read_gbq(query,
project_id="joe-python-analytics",
dialect='standard')
Run Code Online (Sandbox Code Playgroud)
正如您从方法 contract看到的那样,它需要 sereval 关键字参数,因此您使用它的方式没有正确设置标准方言。
| 归档时间: |
|
| 查看次数: |
3036 次 |
| 最近记录: |