Reputation:
I'm new to Hive and I would to select only column that terminated with 'id', for example, movieid, userid etc...
I've tried: SELECT '*+(id)' FROM ratings WHERE movieid = 1;
but it doesn't work.
How can I do a query like this?
Upvotes: 2
Views: 168
Reputation: 1525
Here is you can use regex to match column names you are looking, below is answer,
set hive.support.quoted.identifiers=none;
select `.*id` from ratings WHERE movieid = 1;
Upvotes: 1