使用HEAD将请求发送到BigQuery数据集集合

时间:2021-10-11 14:54:05

We run into strange error when trying to check existence of a dataset in BigQuery via HEAD request executed on App Engine environment. Please see the code below.

当尝试通过在App Engine环境上执行的HEAD请求检查BigQuery中数据集的存在时,我们遇到了奇怪的错误。请参阅下面的代码。

bigquery.datasets().get(projectNumber, datasetId).executeUsingHead();

That code is working successfully if run on local development server, however, when deployed on Google infrastructure, we get IOException.

如果在本地开发服务器上运行,该代码可以成功运行,但是,当部署在Google基础架构上时,我们会获得IOException。

...
Caused by: java.io.IOException: 
at com.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationException(URLFetchServiceImpl.java:148)
at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:43)
at com.google.api.client.extensions.appengine.http.UrlFetchRequest.execute(UrlFetchRequest.java:79)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:980)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:399)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUsingHead(AbstractGoogleClientRequest.java:382)
at com.google.api.services.bigquery.Bigquery$Datasets$Get.executeUsingHead(Bigquery.java:322)
...

Any ideas would be appreciated.

任何想法,将不胜感激。

1 个解决方案

#1


0  

Is there a reason you're not using execute() instead of executeUsingHead()? The datasets.get() operation only returns a single dataset object, which is generally very small.

你有没有使用execute()而不是executeUsingHead()的原因? datasets.get()操作仅返回单个数据集对象,该对象通常非常小。

#1


0  

Is there a reason you're not using execute() instead of executeUsingHead()? The datasets.get() operation only returns a single dataset object, which is generally very small.

你有没有使用execute()而不是executeUsingHead()的原因? datasets.get()操作仅返回单个数据集对象,该对象通常非常小。