Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jackylk committed Jul 21, 2015
1 parent 33a5fd5 commit 0fd3de9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/spark-hbase-demo2.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ Steps:
(1) Create table and populate data in HBase shell
```
$HBase_Home/bin/hbase shell
create 'hbase10k', 'f'
for i in '1'..'10000' do for j in '1'..'2' do put 'hbase10k', "row#{i}", "f:c#{j}", "#{i}#{j}" end end
create 'hbase1k', 'f'
for i in '1'..'1000' do for j in '1'..'2' do put 'hbase10k', "row#{i}", "f:c#{j}", "#{i}#{j}" end end
```

(2) Map hbase table with sparksql table in hbase-sql shell
```
$SPARK_HBASE_Home/bin/hbase-sql
CREATE TABLE spark10k(rowkey STRING, a INTEGER, b INTEGER, PRIMARY KEY (rowkey)) MAPPED BY (hbase10k, COLS=[a=f.c1, b=f.c2]);
CREATE TABLE spark1k(rowkey STRING, a STRING, b STRING, PRIMARY KEY (rowkey)) MAPPED BY (hbase1k, COLS=[a=f.c1, b=f.c2]);
```

(3) Query:
```
// test count *
(1) select count(*) from spark10k
(1) select count(*) from spark1k
// test group by
(2) select avg(a), b from spark10k group by b
(2) select a, b from spark1k where b > "980"
```

0 comments on commit 0fd3de9

Please sign in to comment.