简体   繁体   English

无法按日期创建分区(时间戳)

[英]Cannot create a PARTITION BY DATE(timestamp)

Hello I am using my personal GCP account to play around in Bigquery, and I am still within my free-tier range (a billing account is linked, but no fees incurred yet).您好,我正在使用我的个人 GCP 帐户在 Bigquery 中玩游戏,而且我仍在我的免费套餐范围内(已关联计费帐户,但尚未产生任何费用)。

So I create a table to fetch baseball.games_wide table from bigquery-public-dataset.所以我创建了一个表来从 bigquery-public-dataset 中获取 ballball.games_wide 表。 The following is my simple CREATE TABLE query with PARTITION on a timestamp column ' startTime '.以下是我在时间戳列“ startTime ”上使用 PARTITION 的简单 CREATE TABLE 查询。

CREATE TABLE project.table
PARTITION BY date(startTime) AS

SELECT 
    gameId, seasonID, date(startTime) as game_date, startTime, year
FROM `bigquery-public-data.baseball.games_wide`
WHERE YEAR = 2016

The table was created successfully and I can see the worker has the write phase, which is an indicator that something is writing to the table.表创建成功,我可以看到 worker 处于写入阶段,这表明有东西正在写入表。 However, when I go to 'Preview' the table, there is no data to display, and table size is 0 KB.但是,当我使用 go 来“预览”表格时,没有要显示的数据,表格大小为 0 KB。

在此处输入图像描述

I tried remove the second line (ie, PARTITION BY date(startTime)) when creating table, the data can be ingested and I am able to Preview it in console.我尝试在创建表时删除第二行(即 PARTITION BY date(startTime)),可以摄取数据并且可以在控制台中预览它。 It seems the PARTITION command is causing problem, but I can't tell where goes wrong.似乎 PARTITION 命令引起了问题,但我不知道哪里出了问题。 Any idea?任何想法?

As you have mentioned in the comment this issue is resolved by creating a new dataset after the billing account is linked to the project.正如您在评论中提到的,此问题通过在计费帐户链接到项目后创建一个新数据集来解决。

You can follow thistutorial to create billing account and link it to project.您可以按照本教程创建计费帐户并将其链接到项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM