17.1 hive 설치

# Download a release, and unpack the tarball in a suitable place on your workstation:
% tar xzf apache-hive-x.y.z-bin.tar.gz
# It’s handy to put Hive on your path to make it easy to launch:
% export HIVE_HOME=~/sw/apache-hive-x.y.z-bin
% export PATH=$PATH:$HIVE_HOME/bin
# Now type hive to launch the Hive shell:
% hive
hive>

17.1.1. hive shell

hive> SHOW TABLES;
OK
Time taken: 0.473 seconds
% hive -f script.q
# f -> file
% hive -e 'SELECT * FROM dummy'
OK
X
Time taken: 1.22 seconds, Fetched: 1 row(s)
# e -> 명령행에 직접 입력
% hive -S -e 'SELECT * FROM dummy'
X
# s : 불필요한 메시지 출력을 막아 출력결과만 보게
# 그 밖에 다른 유용 특성으로 명령어 앞에 !를 붙여 호스트 운영체제의 명령어를 실행하는 기능ㅇ과
# dfs 명령어로 하둡 파일 시스템을 조작하는 기능이 있다.

17.2. 예제