hadoop-hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zheng Shao (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (HIVE-420) Support regular expressions for column in select clause
Date Sat, 02 May 2009 00:05:30 GMT

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

Zheng Shao edited comment on HIVE-420 at 5/1/09 5:05 PM:
---------------------------------------------------------

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

{code} "(ds|hr)?+.+" {code} will match all columns except ds and hr.
{code} "(dsa|ds)?+.+" {code} 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}


      was (Author: zshao):
    With Java regex library we can easily support exclusion of several columns:

{code} "^(ds|hr)?+.+$" {code} will match all columns except ds and hr.
{code} "^(dsa|ds)?+.+$" {code} 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
>            Assignee: Zheng Shao
>            Priority: Minor
>             Fix For: 0.4.0
>
>         Attachments: HIVE-420.1.patch, HIVE-420.2.patch, HIVE-420.3.patch, HIVE-420.4.patch
>
>
> 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.


Mime
View raw message