如何从Tableau查询BigQuery中的分区表 [英] How to query a partitioned table in BigQuery from Tableau
问题描述
如何使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屋!