3
我想通过在python-api上使用像QualiferFilter这样的过滤器从HBase获取行。
我知道从代码中获取HBase的行的方式。Spark:如何使用HBase过滤器,例如由python-api提供的QualiferFilter
host = 'localhost'
keyConv = "org.apache.spark.examples.pythonconverters.ImmutableBytesWritableToStringConverter"
valueConv = "org.apache.spark.examples.pythonconverters.HBaseResultToStringConverter"
conf = {"hbase.zookeeper.quorum": host, "hbase.mapreduce.inputtable": "user",
"hbase.mapreduce.scan.columns": "u:uid",
"hbase.mapreduce.scan.row.start": "1", "hbase.mapreduce.scan.row.stop": "100"}
rdd = sc.newAPIHadoopRDD("org.apache.hadoop.hbase.mapreduce.TableInputFormat",
"org.apache.hadoop.hbase.io.ImmutableBytesWritable",
"org.apache.hadoop.hbase.client.Result",
keyConverter=keyConv, valueConverter=valueConv, conf=conf)
但是,我也想通过使用过滤器获得行。
我需要添加什么类型的代码?
你找出如何做到这一点? – void
我找不到解决方案。毕竟,我使用Scala API。我认为Python API还不能用于生产环境。 – penlight