如何解决Dataflow BigTable 按运行时定义的前缀读取行
我正在使用 Google Dataflow 根据行前缀从 BigTable 读取行,并且需要在管道运行之间更改前缀。我没有成功地尝试参数化扫描配置,因为显然没有办法将 ValueProvider 传递给将携带运行时参数的扫描配置。
这是提供静态前缀的扫描配置的代码片段:
// Scan config definition
private static CloudBigtableScanConfiguration getCloudBigtableScanConfiguration(CatalogPipelineOptions options) {
Scan scan = new Scan()
.setCacheBlocks(false)
.setFilter(
// FIXME: How to provide the prefix at runtime/when executing the dataflow template?
new PrefixFilter("prefix-changed-at-runtime-".getBytes())
);
return new CloudBigtableScanConfiguration.Builder()
.withProjectId(options.getBigtableProjectId())
.withInstanceId(options.getBigtableInstanceId())
.withTableId(options.getBigtableTableId())
.withScan(scan)
.build();
}
// Use of the scan config
pipeline.apply("Read from BigTable",Read.from(
CloudBigtableIO.read(getCloudBigtableScanConfiguration(options)))
);
有没有办法将运行时参数传递给扫描配置而不依赖于管道构建期间定义的单个值?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。