如何使用Python BigQuery API追加到BigQuery中的表格 [英] How to append to a table in BigQuery using Python BigQuery API

查看:190
本文介绍了如何使用Python BigQuery API追加到BigQuery中的表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经能够使用 <$ c $从Pandas数据框附加/创建表格c> pandas-gbq 软件包。特别是使用 to_gbq 方法。但是,当我想使用BigQuery Web UI检查表时,我看到以下消息:


此表的流缓冲区中有记录这可能在预览中不可见。


我不是唯一要问的人,而且似乎目前还没有解决方案

所以我的问题是:

1.是否有解决上述问题的方法(即数据在Web UI中不可见)。

2.如果没有解决方案(1),是否有另一种方法可以使用Python BigQuery API将数据追加到现有表中? (请注意,文档说明我可以通过运行异步查询并使用 writeDisposition = WRITE_APPEND ,但链接,它不提供解释如何使用它,我不能解决它)。

该消息仅仅是一个UI通知,它不应该阻碍你。

要检查数据,请运行一个简单的查询并查看它是否存在。


$ b 要只读取仍在Streaming Buffer中的数据,请使用以下查询:

  #standardSQL 
SELECT count(1)
FROM`dataset.table` WHERE _PARTITIONTIME为空


I've been able to append/create a table from a Pandas dataframe using the pandas-gbq package. In particular using the to_gbq method. However, When I want to check the table using the BigQuery web UI I see the following message:

This table has records in the streaming buffer that may not be visible in the preview.

I'm not the only one to ask, and it seems that there's no solution to this yet.

So my questions are:
1. Is there a solution to the above problem (namely the data not being visible in the web UI).
2. If there is no solution to (1), is there another way that I can append data to an existing table using the Python BigQuery API? (Note the documentation says that I can achieve this by running an asynchronous query and using writeDisposition=WRITE_APPEND but the link that it provides doesn't explain how to use it and I can't work it out).

解决方案

That message is just a UI notice, it should not hold you back.

To check data run a simple query and see if it's there.

To read only the data that is still in Streaming Buffer use this query:

#standardSQL    
SELECT count(1) 
FROM `dataset.table` WHERE _PARTITIONTIME is null

这篇关于如何使用Python BigQuery API追加到BigQuery中的表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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