轉自:https://blog.csdn.net/cuichunchi/article/details/109999526
需要使用hive的正則表達式,需要設置hive的參數,在這種配置中,反引號名成被解釋為正則表達式:
set hive.support.quoted.identifiers=none -- 默認set hive.support.quoted.identifiers=column,
-- 查詢hive默認的參數:set;
表中的數據以及列名如下:
日常工作中我們需要用到兩種方式:
第一種:過濾調不需要的列名
如下:SELECT `(id|100name)?+.+` from st;
不需要id和100name的列名
第二種:需要某些有相似性的列名
如下:SELECT `.+name` from st;
需要以name為后綴的所有列名