从表中读取BigQuery数值数据类型

时间:2022-04-03 15:45:40

While reading data from BQ table NUMERIC data type is Still not supported in Apache Beam but using API I can use NUMERIC data type in BQ.

虽然在Apache Beam中仍然不支持从BQ表NUMERIC数据类型读取数据,但使用API​​我可以在BQ中使用NUMERIC数据类型。

So while reading data from BQ with below Snippet:

因此,在使用以下Snippet从BQ读取数据时:

BigQueryIO.readTablerow().from(options.valueprovider);

I got an Exception Numeric is Not supported yet.

我得到了一个Exception Numeric还不支持。

Is there any other way I can read data from BQ if NUMERIC field is Present Except RestAPI Call.

有没有其他方法我可以从BQ读取数据,如果NUMERIC字段存在除RestAPI调用之外。

1 个解决方案

#1


2  

Dataflow now supports reading NUMERIC from BigQuery using the Java library. At the time of this writing, you will either need to download a snapshot release or wait until the next official Beam release in order to make use of this feature.

Dataflow现在支持使用Java库从BigQuery读取NUMERIC。在撰写本文时,您将需要下载快照版本或等到下一个官方Beam版本才能使用此功能。

Edit: if you want to download the current version of Beam, you can do so like this:

编辑:如果你想下载当前版本的Beam,你可以这样做:

~$ git clone https://github.com/apache/beam.git

Then you can use the Gradle build task, for example:

然后,您可以使用Gradle构建任务,例如:

~$ cd beam
~/beam$ ./gradlew build

Or generate files for Eclipse, if you're using it as your development environment:

或者,如果您将其用作开发环境,则为Eclipse生成文件:

~/beam$ ./gradlew -p sdks/java/build-tools/ eclipse

You can find more information about using Gradle in the Gradle user documentation.

您可以在Gradle用户文档中找到有关使用Gradle的更多信息。

#1


2  

Dataflow now supports reading NUMERIC from BigQuery using the Java library. At the time of this writing, you will either need to download a snapshot release or wait until the next official Beam release in order to make use of this feature.

Dataflow现在支持使用Java库从BigQuery读取NUMERIC。在撰写本文时,您将需要下载快照版本或等到下一个官方Beam版本才能使用此功能。

Edit: if you want to download the current version of Beam, you can do so like this:

编辑:如果你想下载当前版本的Beam,你可以这样做:

~$ git clone https://github.com/apache/beam.git

Then you can use the Gradle build task, for example:

然后,您可以使用Gradle构建任务,例如:

~$ cd beam
~/beam$ ./gradlew build

Or generate files for Eclipse, if you're using it as your development environment:

或者,如果您将其用作开发环境,则为Eclipse生成文件:

~/beam$ ./gradlew -p sdks/java/build-tools/ eclipse

You can find more information about using Gradle in the Gradle user documentation.

您可以在Gradle用户文档中找到有关使用Gradle的更多信息。