hive批量执行sql代码遇到的坑

一天,我在dwd操作时建立一张表

create external table if not exists dwd_farm_n.fact_product_general(
rowkey							string,--rowkey
product_code					string,--产品代码
desc_loc 						string,--中文名
desc_eng 						string,--英文名
commercial_name 				string,
search_code 					string,
account_product_type 			string,
mis_product_type 				string,
cancel_flag 					string,
user_create 					string,
create_date 					string,
last_user_id 					string,
last_update_date 				string,
last_function 					string,
sap_material_group 				string,
sap_product_group 				string,
packing_convert_flag 			string,
ref_account_product 			string,
short_product_code 				string
)
row format delimited fields terminated by '\001'
stored  as  textfile;

粘入linux命令行里,回车却出现这样的错误

查了一下,发现hive环境下复制整段语句时,出现 非常多Display all xxx(多少行数字) possibilities? (y or n)错误的时是因为SQL语句中存在tab键导致,tab键在linux系统中是有特殊含义的。所以hive环境才会N多提示这种鬼东西

结论:hive环境中SQL执行语句中应避免使用tab键。SQL语句也建议先处理好格式再去复制执行吧

建议:可以采用空格分隔开(感觉也挺憨憨的),或者保存为sql脚本使用hive -f xx.sql执行

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值