hive删除分区名带特殊字符

hive sql脚本中带变量如:select table_coulm from table_name where dt='{etl_date}'; --dt是分区名

如果变量未赋值,{etl_date}会变成特殊字符dt=$%7Betl_date}

删除带特殊字符的分区:alter table tmp_h02_click_log drop partition(dt='${etl_date}');

直接删除原有的变量名不要带转义字符。

hive 处理字段是忘记起别名 hive会默认生成一个列名如:_c1 

查询_c1 必须用反向引号括起来 `_c1`

猜你喜欢

转载自blog.csdn.net/dingguanyi/article/details/87901527