[ 
https://issues.apache.org/jira/browse/HIVE-420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704565#action_12704565
 ] 

Zheng Shao commented on HIVE-420:
---------------------------------

With Java regex library we can easily support exclusion of several columns:

"^(ds|hr)?+.+$" will match all columns except ds and hr.
"^(dsa|ds)?+.+$" will match all columns except ds and dsa. Note that "dsa" has 
to come before "ds" otherwise it won't work as expected - basically if there 
exists s and t, and s is a prefix of t, then t has to come before s.

When the user is specifying column names, they should not need to specify "^" 
and "$" and we should assume the regex matches the whole string.


Use http://www.fileformat.info/tool/regex.htm for testing the above examples.

{code}
"^(ds|hr)?+.+$" 
Try these:
ds
hr
d
h
s
r
ads
dsa
ahr
hra
dsds
dshr
hrds
hrhr
abc
{code}


> Support regular expressions for column in select clause
> -------------------------------------------------------
>
>                 Key: HIVE-420
>                 URL: https://issues.apache.org/jira/browse/HIVE-420
>             Project: Hadoop Hive
>          Issue Type: New Feature
>          Components: Query Processor
>    Affects Versions: 0.2.0, 0.3.0, 0.3.1, 0.4.0
>            Reporter: Prasad Chakka
>            Priority: Minor
>
> support queries like `select a.[^ds] from a where a.ds='2009-09-09'` which 
> are useful when there are humongous number of columns in a table and want to 
> select all columns except the partitions columns. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to