Skip to content

Commit 0fd3de9

Browse files
author
jackylk
committed
fix doc
1 parent 33a5fd5 commit 0fd3de9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/spark-hbase-demo2.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ Steps:
55
(1) Create table and populate data in HBase shell
66
```
77
$HBase_Home/bin/hbase shell
8-
create 'hbase10k', 'f'
9-
for i in '1'..'10000' do for j in '1'..'2' do put 'hbase10k', "row#{i}", "f:c#{j}", "#{i}#{j}" end end
8+
create 'hbase1k', 'f'
9+
for i in '1'..'1000' do for j in '1'..'2' do put 'hbase10k', "row#{i}", "f:c#{j}", "#{i}#{j}" end end
1010
```
1111

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

1818
(3) Query:
1919
```
2020
// test count *
21-
(1) select count(*) from spark10k
21+
(1) select count(*) from spark1k
2222
2323
// test group by
24-
(2) select avg(a), b from spark10k group by b
24+
(2) select a, b from spark1k where b > "980"
2525
```

0 commit comments

Comments
 (0)