Re: Multiple insert statement and levels of aggregation

2010-10-15 Thread Alex Boisvert
Cool, I hadn't come across lateral views yet. I'll see if I can use that. thanks!! alex On Fri, Oct 15, 2010 at 11:17 AM, Ning Zhang wrote: > In the multi-insert statement, you cannot put another FROM clause. What you > can do is to put both UDTF in the FROM clause: > > FROM foo lateral view

Re: Multiple insert statement and levels of aggregation

2010-10-15 Thread Ning Zhang
In the multi-insert statement, you cannot put another FROM clause. What you can do is to put both UDTF in the FROM clause: FROM foo lateral view someUDTF(foo.a) as t1_a lateral view anotherUDTF(foo.a) as T2_a INSERT ... SELECT a,b,c,count(1), t1_a .. SELECT a,b,c,count(1), t2_a .. On Oct 15, 2

Multiple insert statement and levels of aggregation

2010-10-15 Thread Alex Boisvert
Hi, I'd like to write a multiple-insert select statement where I need to call different UDTFs and perform several levels of aggregation based on the result of the initial table, e.g., FROM (SELECT * from TABLE foo) foo INSERT OVERWRITE TABLE bar SELECT a, b, c, count(1) FROM (SELECT someUDTF(fo