1.直接在hive的命令栏中 进行查询 结果反馈到页面中
select * from zc_dwa.dwa_v_m_cus_pp_imei_net where month_id='201609' and device_number = '1557832'
2.hive -e 命令 把结果保存到res.csv文件中
bin/hive -e "select * from zc_dwa.dwa_v_m_cus_pp_imei_net where month_id='201609' and device_number = '1557832'" >> /data/all_zc_pro/gxqing/res.csv
3.hive -f 命令 把sql语言写到stu.sql中,结果保存到hivef.txt 中
bin/hive -f stu.sql > /data/all_zc_pro/gxqing/hivef.txt
编写sql脚本:
vi stu.sql
select * from zc_dwa.dwa_v_m_cus_pp_imei_net where month_id='201609' and device_number = '1557832'