Monday
beeline 변수 사용하기 본문
report.sql이란 파일이 다음과 같이 저장되어 있을 때 beeline을 통해서 사용하는 법을 보여드리겠습니다.
# report.sql
SELECT * FROM accounting.current WHERE month= '${hivevar:month}'
or
# report.sql (변수 선언 포함)
SET hivevar:month = October;
SELECT * FROM accounting.current WHERE month= '${hivevar:month}'
사용법
$ beeline -u jdbc:hive2://localhost:10000 --hivevar month="October" -f report.sql
'빅데이터 > Hive' 카테고리의 다른 글
Hive Query - NULL 처리 (0) | 2021.02.22 |
---|---|
Hive&Impala Query 문자열 패턴 매칭 (0) | 2021.02.22 |
Hive Query비대화형(Non-interactive) 모드 - Beeline (0) | 2021.02.22 |
Comments