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

问题描述

我想知道是否可以查询hive ith term rehiliare selection 中的列是否可以用于某些描述的起始列?

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?

示例:带有此列名称列表的表模式1 模式2 主题3 balab1 balabal2 ma1 ma2 ma3

example:table with this list of names of columnspattern1 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 了解更多信息.

Please see https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select#LanguageManualSelect-REGEXColumnSpecification for more information.

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

08-04 16:24
查看更多