Skip to content

Commit 7b88e75

Browse files
committed
Update spark-hbase-demo2.md
1 parent 20ee45c commit 7b88e75

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
@@ -1,20 +1,20 @@
1-
## create spark sql table map to existing hbase (only single column mapping to hbase rowkey is supported)
2-
(1) create table in hbase
1+
## Create spark sql table map to existing hbase (only single column mapping to hbase rowkey is supported)
2+
(1) Create table in hbase, populate data
33
```
44
create 'hbase10k', 'f'
55
for i in '1'..'10000' do for j in '1'..'2' do put 'hbase10k', "row#{i}", "f:c#{j}", "#{i}#{j}" end end
66
```
77

8-
(2) relate 'test' from SparkOnHbase
8+
(2) Map hbase table with sparksql table
99
```
1010
CREATE TABLE spark10k(rowkey STRING, a INTEGER, b INTEGER, PRIMARY KEY (rowkey)) MAPPED BY (hbase10k, COLS=[a=f.c1, b=f.c2]);
1111
```
1212

13-
(3) Query :
13+
(3) Query:
1414
```
1515
// test count *
1616
(1) select count(*) from spark10k
1717
1818
// test group by
1919
(2) select avg(a), b from spark10k group by b
20-
```
20+
```

0 commit comments

Comments
 (0)