【问题标题】:BigQuery: Failed to create view. Unexpected. Please try againBigQuery:无法创建视图。意外。请再试一次
【发布时间】:2014-09-11 04:47:41
【问题描述】:

我正在尝试在 BigQuery 中保存视图,但一直收到相同的错误:

Failed to create view. Unexpected. Please try again.

查询如下:

SELECT
interaction.id AS Interaction.ID,
interaction.author.name AS Interaction.Author.Name,
interaction.author.username AS Interaction.Author.Username,
interaction.content AS Interaction.Content,
interaction.created_at_timestamp AS Interaction.Created_At_Timestamp,
klout.score AS Klout.Score,
twitter.geo.latitude AS Twitter.Geo.Latitude,
twitter.geo.longitude AS Twitter.Geo.Longitude,
twitter.media.expanded_url AS Twitter.Media.ExpandedUrl,
twitter.media.type AS Twitter.Media.Type,
twitter.place.country AS Twitter.Place.Country,
twitter.user.followers_count AS Twitter.User.Followers,
twitter.user.friends_count AS Twitter.User.Friends,
twitter.user.listed_count AS Twitter.User.Listed,
twitter.retweet.count AS Twitter.Retweet.Count
FROM
[**DATASET_NAME_OMITTED**.main_table]
WHERE
(interaction.id IS NOT NULL)
AND (interaction.created_at_timestamp IS NOT NULL)
AND (interaction.created_at_timestamp >= DATE_ADD(USEC_TO_TIMESTAMP(UTC_USEC_TO_HOUR(NOW())), -1, "DAY"))
AND (interaction.created_at_timestamp < USEC_TO_TIMESTAMP(UTC_USEC_TO_HOUR(NOW())))

查询验证并运行没有任何问题:

Valid: This query will process 203 MB when run.

我确实注意到 twitter.media 是 REPEATED RECORD 类型。也就是说,删除 twitter.media.* 字段并不能解决问题。

我已经能够成功保存具有相同时间戳限制和命名约定的其他视图。尝试保存此文件始终失败。

对于上下文:此表由 DataSift 通过其 BigQuery 连接器填充(默认,包罗万象的架构)。

【问题讨论】:

    标签: google-bigquery


    【解决方案1】:

    这真的很奇怪。 我进行了一个实验并提取了每个别名操作,并且它起作用了。 然后我慢慢地把它们中的一些重新加入,一次又一次;它继续工作。但是,某些别名似乎不想工作(我不知道为什么)。 我最终得到了以下内容,其中包含您的大部分别名,并且似乎按预期工作:

    SELECT
    interaction.id AS Interaction.ID,
    interaction.author.name AS Interaction.Author.Name,
    interaction.author.username AS Interaction.Author.Username,
    interaction.content AS Interaction.Content,
    interaction.created_at_timestamp AS Interaction.Created_At_Timestamp,
    klout.score AS Klout.Score,
    twitter.geo.latitude AS Twitter.Geo.Latitude,
    twitter.geo.longitude AS Twitter.Geo.Longitude,
    twitter.media.expanded_url,
    twitter.media.type AS Twitter.Media.Type,
    twitter.place.country AS Twitter.Place.Country,
    twitter.user.followers_count,
    twitter.user.friends_count,
    twitter.user.listed_count,
    twitter.retweet.count AS Twitter.Retweet.Count
    FROM [**DATASET_NAME_OMITTED**.main_table] 
    WHERE
    (interaction.id IS NOT NULL)
    AND (interaction.created_at_timestamp IS NOT NULL)
    AND (interaction.created_at_timestamp >= DATE_ADD(USEC_TO_TIMESTAMP(UTC_USEC_TO_HOUR(NOW())), -1, "DAY"))
    AND (interaction.created_at_timestamp < USEC_TO_TIMESTAMP(UTC_USEC_TO_HOUR(NOW())))
    

    看起来很奇怪的是,在什么会起作用和不会起作用之间没有模式。 twitter.user.* 字段是整数,但不接受别名,但整数字段 klout.score 字段接受整数。

    【讨论】:

    • 感谢您对此进行调查并缩小问题范围。我拥有的别名并不是一成不变的,因此这对我来说不是一个完整的问题。不过,最好让 Google 的人来看看,让我们知道根本问题是什么。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-06
    相关资源
    最近更新 更多