Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 在ApacheBeam中编写内部连接的最佳有效方法是什么?_Google Cloud Platform_Google Cloud Dataflow_Apache Beam - Fatal编程技术网

Google cloud platform 在ApacheBeam中编写内部连接的最佳有效方法是什么?

Google cloud platform 在ApacheBeam中编写内部连接的最佳有效方法是什么?,google-cloud-platform,google-cloud-dataflow,apache-beam,Google Cloud Platform,Google Cloud Dataflow,Apache Beam,假设我的查询是:“从sourav_test.test1a内部连接sourav_test.test2b on a.id=b.id中选择b.*”。我需要apache beam的最佳和高效的方法来编写这篇文章。在apache beam SDK 2.5中,一个很好的方法是使用执行类似SQL的连接的。对于内部联接,语法如下所示: innerJoin(PCollection<KV<K,V1>> leftCollection,PCollection<KV<K,V2>&

假设我的查询是:“从
sourav_test.test1
a内部连接
sourav_test.test2
b on a.id=b.id中选择b.*”。我需要apache beam的最佳和高效的方法来编写这篇文章。

在apache beam SDK 2.5中,一个很好的方法是使用执行类似SQL的连接的。对于内部联接,语法如下所示:

innerJoin(PCollection<KV<K,V1>> leftCollection,PCollection<KV<K,V2>> rightCollection)
innerJoin(PCollection leftCollection,PCollection rightCollection)

与您的案例相关,左侧集合和侧面集合表示要内部连接的集合。K值将是与这两个集合相关的键的类型。Vs将分别表示每个集合的值

如果您的输入数据源恰好是BigQuery,那么在将其拉入beam/dataflow之前在BigQuery中执行连接可能会更有效。