diff options
-rw-r--r-- | examples/src/main/python/hbase_inputformat.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/src/main/python/hbase_inputformat.py b/examples/src/main/python/hbase_inputformat.py index e17819d5fe..5b82a14fba 100644 --- a/examples/src/main/python/hbase_inputformat.py +++ b/examples/src/main/python/hbase_inputformat.py @@ -54,8 +54,9 @@ if __name__ == "__main__": Run with example jar: ./bin/spark-submit --driver-class-path /path/to/example/jar \ - /path/to/examples/hbase_inputformat.py <host> <table> + /path/to/examples/hbase_inputformat.py <host> <table> [<znode>] Assumes you have some data in HBase already, running on <host>, in <table> + optionally, you can specify parent znode for your hbase cluster - <znode> """, file=sys.stderr) exit(-1) @@ -64,6 +65,9 @@ if __name__ == "__main__": sc = SparkContext(appName="HBaseInputFormat") conf = {"hbase.zookeeper.quorum": host, "hbase.mapreduce.inputtable": table} + if len(sys.argv) > 3: + conf = {"hbase.zookeeper.quorum": host, "zookeeper.znode.parent": sys.argv[3], + "hbase.mapreduce.inputtable": table} keyConv = "org.apache.spark.examples.pythonconverters.ImmutableBytesWritableToStringConverter" valueConv = "org.apache.spark.examples.pythonconverters.HBaseResultToStringConverter" |