hive 함수를 보려면 다음 명령어를 사용한다.
SHOW FUNCTIONS;
DESCRIBE FUNCTION 함수이름;
DESCRIBE FUNCTION EXTENDED 함수이름;
예)
> DESCRIBE FUNCTION xpath_string;
OK
xpath_string(xml, xpath) - Returns the text contents of the first xml node that matches the xpath expression
Time taken: 0.006 seconds, Fetched: 1 row(s)
> DESCRIBE FUNCTION EXTENDED xpath_string;
OK
xpath_string(xml, xpath) - Returns the text contents of the first xml node that matches the xpath expression
Example:
> SELECT xpath_string('<a><b>b</b><c>cc</c></a>','a/c') FROM src LIMIT 1;
'cc'
> SELECT xpath_string('<a><b>b1</b><b>b2</b></a>','a/b') FROM src LIMIT 1;
'b1'
> SELECT xpath_string('<a><b>b1</b><b>b2</b></a>','a/b[2]') FROM src LIMIT 1;
'b2'
> SELECT xpath_string('<a><b>b1</b><b>b2</b></a>','a') FROM src LIMIT 1;
'b1b2'
Time taken: 0.01 seconds, Fetched: 10 row(s)
'hadoop' 카테고리의 다른 글
[hive] HiveServer2 (0) | 2016.04.16 |
---|---|
install hadoop 1.2.1 and hive 1.0.1 (0) | 2016.03.29 |
[hive] 하이브는 등가 조인(equal join)만 지원한다. (0) | 2016.03.25 |
[hive] 데이터를 하나로 합치기 (0) | 2016.02.29 |
[hive] 날짜 구하기 (0) | 2016.02.26 |