HIVE选择带有正则表达式的列名称吗? [英] HIVE Select columns names with regular expression?

查看:159
本文介绍了HIVE选择带有正则表达式的列名称吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以对某些描述的起始列的第i个词"rehiliare"选择中的列进行查询?

I want to know if it can be queried about the columns in the hive ith term rehiliare selection for the starting columns of some description?

示例:带有此列名称列表的表pattern1 pattern2motif3 balab1 balabal2 ma1 ma2 ma3

example: table with this list of names of columns pattern1 pattern2 motif3 balab1 balabal2 ma1 ma2 ma3

select(该选择列具有模式的初学者的表达式)从表中

select (an expression for that selection columns beginners with pattern) from table

谢谢

推荐答案

我相信您正在寻找根据正则表达式选择列的方法.

I believe you are looking to select columns based on regular expression.

下面的工作原理:

  set hive.support.quoted.identifiers=none;
  select `patt.*` from test_table;

以上代码将返回您提到的"pattern1 pattern2motif3 balab1 balabal2 ma1 ma2 ma3"列中的pattern1 pattern2

Above code will return columns pattern1 pattern2 among your mentioned columns "pattern1 pattern2 motif3 balab1 balabal2 ma1 ma2 ma3"

请参阅 https://cwiki.apache.org/confluence/display/Hive/LanguageManual + Select#LanguageManualSelect-REGEXColumnSpecification .

这篇关于HIVE选择带有正则表达式的列名称吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆