如何从Tableau查询BigQuery中的分区表 [英] How to query a partitioned table in BigQuery from Tableau

查看:344
本文介绍了如何从Tableau查询BigQuery中的分区表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在google bigquery中有一个分区表,我们使用_PARTITIONTIME字段进行查询(否则查询将花费太多)。



如何使Tableau使用_PARTITIONTIME伪列?

解决方案

在Tableau中配置数据源时,从可用源列表中选择Google BigQuery OAuth舞蹈,然后选择你的项目和数据集。

此时,您将看到数据集中的表格列表,以及底部使用新建自定义SQL的选项。选择此选项,然后按照您一直使用的方式输入您的查询。假设查询包含类似于以下的段:

  ... WHERE _PARTITIONTIME BETWEEN TIMESTAMP(2016-05-01 )AND TIMESTAMP(2016-05-06)

现在,突出显示其中的日期子句并单击查询编辑器中的插入参数下拉菜单。这将允许您参数化查询,并从Tableau工作簿中动态选择要查询的日期!



希望这有助于!


We have a partitioned table in google bigquery that we query using the _PARTITIONTIME field (otherwise the queries will cost too much).

How can I make Tableau use _PARTITIONTIME pseudo column?

解决方案

When configuring your datasource in Tableau, select "Google BigQuery" from the list of available sources, go through the OAuth dance, and then select your project and dataset.

At this point, you will be presented with a list of tables in the dataset, as well as an option to use "New Custom SQL" at the bottom. Select this option, and enter your query exactly as you have been using it. Assuming that the query contains a segment similar to the below:

...WHERE _PARTITIONTIME BETWEEN TIMESTAMP("2016-05-01") AND TIMESTAMP("2016-05-06")

Now, highlight the dates within that where clause and click on the "Insert Parameter" dropdown menu in the query editor. This will allow you to parameterize your query and dynamically choose the dates you want to query from within your Tableau workbook!

Hopefully this helps!

这篇关于如何从Tableau查询BigQuery中的分区表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆