HBase 를 기반으로 한느 phoenix 문법에는 update 가 없네...

그래서 찾아본 결과 다음과 같은 문법을 통해 update values 를 할 수 있다.

 

 

< 기본 테이블 >

select * from eyeballs_test;

+-----+----+----+----+
| ID  | A  | B  | C  |
+-----+----+----+----+
| 3   | a  | b  | c  |
| 2   | a  | b  | c  |
| 1   | a  | b  | c  |
+-----+----+----+----+

 

< id 가 2인 row 의 B column 값을 X 로 변경 >

upsert into eyeballs_test(id, b) select '2' as id, 'X' as b from eyeballs_testwhere id='2';

select * from eyeballs_test;

+-----+----+----+----+
| ID  | A  | B  | C  |
+-----+----+----+----+
| 3   | a  | b  | c  |
| 2   | a  | X  | c  |
| 1   | a  | b  | c  |
+-----+----+----+----+

 

 

< id 가 2인 row 의 B column 값을 Y 로 변경 >

upsert into eyeballs_test(id, b) select '2', 'Y' from eyeballs_testwhere id='2';

select * from eyeballs_test;

+-----+----+----+----+
| ID  | A  | B  | C  |
+-----+----+----+----+
| 3   | a  | b  | c  |
| 2   | a  | Y  | c  |
| 1   | a  | b  | c  |
+-----+----+----+----+

 

 

 

참고

https://phoenix.apache.org/python.html

 

+ Recent posts