简体   繁体   English

在 Bigquery 中合并数据集

[英]Merging datasets in Bigquery

After upgrading to Google Analytics in my Firebase project I linked up to a new GA property and had to re-setup my Bigquery integration (after accidentally linking/unlinking my GA account, my integration was turned off).在我的 Firebase 项目中升级到 Google Analytics 后,我链接到一个新的 GA 属性,并且不得不重新设置我的 Bigquery 集成(在意外链接/取消链接我的 GA 帐户后,我的集成被关闭)。 I got it fixed by linking again but now all new data is fed into a new analytics_* dataset.我通过再次链接修复了它,但现在所有新数据都被输入到一个新的analytics_*数据集中。

Since all my queries are referring to the old dataset it would be quite the effort renaming all of them to link to both the new dataset + the old dataset.由于我所有的查询都指的是旧数据集,因此将它们全部重命名以链接到新数据集+旧数据集将是相当大的努力。 Is it possible to either:是否可以:

  • Change the destination table in the firebase Bigquery export (choosing the old dataset instead of the newly created one)更改 firebase Bigquery 导出中的目标表(选择旧数据集而不是新创建的数据集)
  • Somehow merge the two datasets (instead of copying them)以某种方式合并两个数据集(而不是复制它们)

I understood it's impossible to rename datasets which would solve my issue if I could change the name of the new set to the old name and copy the contents of the old set to the new one.我知道如果我可以将新集合的名称更改为旧名称并将旧集合的内容复制到新集合,那么重命名数据集将解决我的问题是不可能的。

UPDATE更新

I was able to fix it by:我能够通过以下方式修复它:

This started feeding data back into my old property.这开始将数据反馈到我的旧财产中。 I subsequently copied the partitioned tables from the newly created property/ table back into the old property (in Bigquery) using the same naming convention (eg. events_20190101 ) which correctly copied them in the partitioned dataset.随后,我使用相同的命名约定(例如events_20190101 )将新创建的属性/表中的分区表复制回旧属性(在 Bigquery 中),从而将它们正确复制到分区数据集中。 I had to append some intraday events as well to the existing partitioned dataset but this solved my problem in the end.我不得不 append 一些日内事件以及现有的分区数据集,但这最终解决了我的问题。

According to the BigQuery export schema document for each single Firebase project linked to BigQuery, a single dataset named "analytics_" is added to your Bigquery project and such ID refers to your Analytics Property ID located in the Analytics Settings in Firebase (Settings -> Integrations -> Google Analytics).根据链接到 BigQuery 的每个 Firebase 项目的BigQuery 导出架构文档,名为“analytics_”的单个数据集将添加到您的 Bigquery 项目中,并且该 ID 指的是位于 Firebase 中的分析设置中的分析属性 ID(设置 -> 集成-> 谷歌分析)。 It seems that this ID is generated automatically when you set up a property and it can be manually changed to a custom one. 设置属性时似乎会自动生成此 ID,并且可以手动将其更改为自定义 ID。

Additionally, there's no way to merge datasets than copy the data between them.此外,除了在它们之间复制数据之外,没有其他方法可以合并数据集。 Thus, you could consider using scheduled queries to append the data in your old dataset.因此,您可以考虑使用计划查询append 旧数据集中的数据。

Hope it helps希望能帮助到你

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

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