1

如何使用 Apache Beam 从 Hive 读取/如何在 Apache Beam 中使用 Hive 作为源?

4

2 回答 2

0

HadoopInputFormatIO 可用于从 Hive 读取,如下所示:

Configuration conf = new Configuration();
conf.setClass("mapreduce.job.inputformat.class", HCatInputFormat.class, 
InputFormat.class);
conf.setClass("key.class", LongWritable.class, WritableComparable.class);
conf.setClass("value.class", DefaultHCatRecord.class, Writable.class);
conf.set("hive.metastore.uris", "...");
HCatInputFormat.setInput(hiveConf, "myDatabase", "myTable", "myFilter");


PCollection<KV<LongWritable, DefaultHCatRecord>> data =
p.apply(HadoopInputFormatIO.<Long, 
DefaultHCatRecord>read().withConfiguration(conf));
于 2017-05-23T16:30:37.990 回答
0

2017 年 7 月合并的拉取请求允许通过https://issues.apache.org/jira/browse/BEAM-2357Beam 2.1.0提供支持。hiveHCatalog

于 2018-01-09T01:44:59.700 回答