- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Whether Hive supports Hive Select All Query with Except Columns, like SQL supports??
- Labels:
-
Apache Hive
Created ‎12-22-2015 05:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ Ana Gilan, Thanks, it works.
Created ‎04-17-2017 04:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you please elaborate how this regex works ?
