Sir I want to retrieve names of fields having a particular value. How can it be done on a single table and across multiple tables?
G Sudha --- On Mon, 10/1/12, Harsh J <ha...@cloudera.com> wrote: From: Harsh J <ha...@cloudera.com> Subject: Re: doubts reg Hive To: common-user@hadoop.apache.org Date: Monday, October 1, 2012, 11:13 AM Sudha, On Mon, Oct 1, 2012 at 9:31 AM, sudha sadhasivam <sudhasadhasi...@yahoo.com> wrote: > We are doing a project in Hive. > Given a field / value is it possible to find the corresponding >headers (meta data). > For example if we have a table with id, user, work_place, >residence_place > given a value "New York" we need to display the headers where New York >appears ( for eg work_place, residence_place etc. > > Kindly intimate whether it is possible. If so what is the command for the >same? It is certainly possible and is a trivial requirement. All you're doing is a filtering here, across multiple columns (OR-wise). Perhaps something like (Pardon if naive/wrong): "SELECT * FROM people WHERE residence_place LIKE '%New York%' OR work_place LIKE '%New York%';" In any case, for Hive questions, you are better off asking the u...@hive.apache.org lists than the Hadoop user lists here. -- Harsh J