如何通过HTTP API获取BigQuery查询的元数据 [英] How do I get the metadata for a BigQuery query through the HTTP api

查看:94
本文介绍了如何通过HTTP API获取BigQuery查询的元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究F#的类型提供程序,为了实现它,我们需要为查询编译时间获取模式,这意味着它必须快速。截至目前,我们运行如下所示:

  bq查询--format = json --dry_run = true --use_legacy_sql = false'SELECT @a IS TRUE AS x,@b + 1 AS y,foo= @c AS z,[tomas,jansson] as w,STRUCT(watas t,69 as u) as v,[STRUCT(3,alloas g),STRUCT(5 as a,yolo)] as u,STRUCT([a] as h)as t;'

完全符合我们的要求,但它使用 bq 工具。我想知道底层的http调用是什么,我无法在代码库中找到它。



我想知道底层代码库的原因是因为我想删除尽可能多的第三方依赖关系,这可能无法在构建服务器上使用,或需要很长时间才能建立。

>或者您可以使用

作业:插入 查询配置属性和 dryRun 设置为true

I'm working on a type provider for F# and to implement it we need to get the schema for the query compile time, which means it has to be fast. As of the moment we run something like this:

bq query --format=json --dry_run=true --use_legacy_sql=false 'SELECT @a IS TRUE AS x, @b + 1 AS y, "foo" = @c AS z, ["tomas", "jansson"] as w, STRUCT("wat" as t, 69 as u) as v, [STRUCT(3, "allo" as g), STRUCT(5 as a, "yolo")] as u, STRUCT(["a"] as h) as t;'

which does exactly what we want, but it uses the bq tool. I want to know what the underlying http call is which I have trouble finding in the code base.

The reason I want to know the underlying code base is because I want to remove as much of third party dependencies as possible which might not be available on a build server or take a long time setting up.

解决方案

Or you can use

Jobs: insert with query configuration property and dryRun set to true

这篇关于如何通过HTTP API获取BigQuery查询的元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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