Hive常用交互命令—悟空智慧教育

1.“-e”不进入hive的交互窗口执行sql语句$ bin/hive -e "select id from student;"2.“-f”执行脚本中sql语句 (1)在/opt/module/datas目录下创建hivef.sql文件[hadoop@master datas]$ touch hivef.sql 文件中写入正确的sql语句 select *from student; (2)执行文件中的sql语句$ bin/hive -f /opt/module/datas/hivef.sql(3)执行文件中的sql语句并将结果写入文件中$ bin/hive -f /opt/module/datas/hivef.sql > /opt/module/datas/hive_result.txt

以上文章内容来源于《悟空智慧教育》:www.wukongone.com,《悟空智慧教育》是一家专业的大数据视频教学网,专属定制您的未来。

猜你喜欢

转载自www.cnblogs.com/wukongone/p/11938635.html
今日推荐