(7-4)hive与外部资源的交互


与Linux交互命令:
hive> !ls;
aa
bin
conf
derby.log
examples
hcatalog
lib
LICENSE
metastore_db
mydate
NOTICE
README.txt
RELEASE_NOTES.txt
scripts
shell


hive> !pwd;
/usr/local/hive-0.14.0
hive>





与HDFS交互命令:
把操作HDFS的命令前面的HDFS去掉即可。


hive> dfs -ls /;
Found 23 items
drwxr-xr-x   - root supergroup          0 2015-04-09 20:52 /alibaba
drwxr-xr-x   - root supergroup          0 2015-04-02 20:18 /input
hive> dfs  -mkdir /hello;
hive> dfs -ls /;
Found 24 items
drwxr-xr-x   - root supergroup          0 2015-04-09 20:52 /alibaba
drwxr-xr-x   - root supergroup          0 2015-04-20 16:40 /hello
drwxr-xr-x   - root supergroup          0 2015-04-02 20:18 /input
hive> dfs -rm -R /hello;
Moved: 'hdfs://192.168.1.10:9000/hello' to trash at: hdfs://192.168.1.10:9000/user/root/.Trash/Current
hive> dfs -ls /;
Found 23 items
drwxr-xr-x   - root supergroup          0 2015-04-09 20:52 /alibaba
drwxr-xr-x   - root supergroup          0 2015-04-02 20:18 /input
hive>






你可能感兴趣的:(7-4hive与外部资源的交互)