Support Questions

Find answers, ask questions, and share your expertise

Whether Hive supports Hive Select All Query with Except Columns, like SQL supports??

avatar
Rising Star

Whether Hive supports Hive Select All Query with Except Columns, like SQL supports. E.g. in SQL if I want tioexclude few columns, i can do by writing in except e.g. SELECT * [except Injury,Detailed_Body_Part, Detailed_Injury_Type] FROM Claim_Grouped). Is the same thing Hive supports??

1 ACCEPTED SOLUTION

avatar

According to this Hive Language documentation, you can achieve the same thing using regular expressions:

A SELECT statement can take regex-based column specification in Hive releases prior to 0.13.0, or in 0.13.0 and later releases if the configuration property hive.support.quoted.identifiers is set to none.

* We use Java regex syntax. Try http://www.fileformat.info/tool/regex.htm for testing purposes.

* The following query selects all columns except ds and hr.

SELECT `(ds|hr)?+.+` FROM sales

View solution in original post

3 REPLIES 3

avatar

According to this Hive Language documentation, you can achieve the same thing using regular expressions:

A SELECT statement can take regex-based column specification in Hive releases prior to 0.13.0, or in 0.13.0 and later releases if the configuration property hive.support.quoted.identifiers is set to none.

* We use Java regex syntax. Try http://www.fileformat.info/tool/regex.htm for testing purposes.

* The following query selects all columns except ds and hr.

SELECT `(ds|hr)?+.+` FROM sales

avatar
Rising Star

@ Ana Gilan, Thanks, it works.

avatar
New Contributor

Could you please elaborate how this regex works ?