从 Table 读取 BigQuery 数值数据类型

Reading BigQuery Numeric Data Type From Table

从 BQ 读取数据时 table NUMERIC 数据类型在 Apache Beam 中 仍然不受支持 但使用 API 我可以使用 NUMERIC BQ 中的数据类型。

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

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

我得到一个异常数字是还不支持

如果 NUMERIC 字段存在,除了 RestAPI 调用,我还有其他方法可以从 BQ 读取数据吗?

Dataflow 现在支持 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 以便使用此功能。

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

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

然后可以使用Gradlebuild任务,例如:

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

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

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

您可以找到有关使用 Gradle in the Gradle user documentation 的更多信息。