我们如何使用正则表达式在蜂巢中删除分区。有可能吗?

时间:2019-04-25 11:18:33

标签: regex hive

我正在尝试运行以下

alter table historical_data drop partition (my_date not rlike '[A-Za-z]');

哪个给我例外

org.apache.hadoop.hive.ql.parse.ParseException: line 2:69 mismatched input 'not' expecting set null in drop partition statement

我找不到类似的东西。我确实在SO中的某个问题上看到了一个答案,但这是行不通的。

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

很遗憾,不支持Regexp。

您可以使用所有这些比较器< > <= >= <> = !=,也许会有所帮助。

查看此吉拉solution

还有一个尚未实施的吉拉:Extend ALTER TABLE DROP PARTITION syntax to use all comparators

Extend ALTER TABLE DROP PARTITION syntax to use multiple conditions在放置分区中:

alter table historical_data drop partition (year < 1995, last_name like 'A%');

创建了Impala supports LIKE,请根据需要在Jira中投票。

相关问题