使用python api客户端的GZIP谷歌大查询响应

时间:2022-12-16 15:25:39

How do I get the query response gzipped when I am using python api client for Google Big Query ?

当我使用python api客户端进行Google Big Query时,如何获取查询响应?

Here is the code snippet :

这是代码片段:

jobData = {'configuration':
                         ......
                          }

jobCollection = self.service.jobs()
insertResponse = jobCollection.insert(projectId=project_id,
                                     body=jobData).execute()
queryResponse = jobCollection.getQueryResults(
        projectId=project_id,
        jobId=insertResponse['jobReference']['jobId'],
        startIndex=currentRow).execute()

1 个解决方案

#1


Are you trying to gzip the json response after the query is complete? Or are you trying to gzip a table you created using a query result? In either case you can easily gzip a json file on your server or export a query result table google storage, then download and gzip.

您是否在查询完成后尝试gzip json响应?或者您是否尝试使用查询结果gzip创建的表?在任何一种情况下,您都可以轻松地在服务器上gzip json文件或导出查询结果表谷歌存储,然后下载和gzip。

#1


Are you trying to gzip the json response after the query is complete? Or are you trying to gzip a table you created using a query result? In either case you can easily gzip a json file on your server or export a query result table google storage, then download and gzip.

您是否在查询完成后尝试gzip json响应?或者您是否尝试使用查询结果gzip创建的表?在任何一种情况下,您都可以轻松地在服务器上gzip json文件或导出查询结果表谷歌存储,然后下载和gzip。