SELECT query on hive

Viewed 74

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?

1 Answers

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;
Related