您的位置:首页 > 其它

HIVE仓库基础知识:基本命令

2018-03-08 14:25 399 查看
1.从hive中查询并导出为txt文件到Linux服务器上:hive -e "select * from xj6500.fct_vecl_insur_pft_2 where daypt between '2017-10-31' and '2017-11-28'" > /home/data/hiveexport/fct_vecl_insur_pft_3/fct_vecl_insur_pft_3.txt;
2.直接执行hql文件hive -f /opt/xj6500_data/hive_sql/updatesql.hql
编码后:hive\u0020-f\u0020/opt/xj6500_data/hive_sql/updatesql.hql

3.从文本向数据库表加载数据(注意:此时的表类型必须为textfile格式)load data local inpath '/opt/spacewalk/hy_test.txt' into table test_hy2;
4.从hive中查询并到出txt文件到hdfs上
insert overwrite local directory '/data/spacewalk/origin_file/hive/dim_agent_l1_channel' ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE  select * from dim_agent_l1_channel;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  HIVE仓库