Question about View in Hive 0.6

2010-12-28 Thread Neil Xu
in hive 0.6, we can create view for tables, views are actually run as a subquery when querying data, is it optimized in hive that a view is executed only once in a single query? Thanks in advance! such as: select * from ( select x,y from view1 where cond1 union all

Re: IN clause usage in "where"

2010-10-11 Thread Neil Xu
you can try find_in_set(string str, string strList) , ex. *select col1 from table1 where find_in_set(col1, 'abc,xyz')<>0;* if col1 has NULL values, it can be modified as *select col1 from table1 where find_in_set( *coalesce(*col1,'') , 'abc,xyz')<>0;* the details about find_in_set are at https:

Can hive sql do the same job like this?

2010-10-08 Thread Neil Xu
In oracle, select a.str1, b.str2 from ( select str1 from table1) a, ( select str2 from table2) b where instr(a.str1,a.str2) > 0 I know that 'from a, b' is not supported in hive, but table1 and table2 have no common keys, if 'join' is used, it will be a FULL OUTER JOIN, when table1