Created 12-22-2015 05:49 PM
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??
Created 12-22-2015 05:56 PM
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
Created 12-22-2015 05:56 PM
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
Created 12-22-2015 06:36 PM
@ Ana Gilan, Thanks, it works.
Created 04-17-2017 04:42 PM
Could you please elaborate how this regex works ?