RE: how to get counts as a byproduct of a query

2015-12-03 Thread Ryan Harris
ember 03, 2015 10:14 AM To: user@hive.apache.org Subject: RE: how to get counts as a byproduct of a query Ryan, Thanks for your reply. Your previous response gave me some hints. I think below will scan tables just once: from table_A a join table_B b on a.X = b.X insert INTO TABLE table_C selec

RE: how to get counts as a byproduct of a query

2015-12-03 Thread Frank Luo
count(b.X) ; From: Ryan Harris [mailto:ryan.har...@zionsbancorp.com] Sent: Wednesday, December 02, 2015 4:20 PM To: user@hive.apache.org Subject: RE: how to get counts as a byproduct of a query Personally, I'd do it this way... https://cwiki.apache.org/confluence/display/Hive/LanguageM

RE: how to get counts as a byproduct of a query

2015-12-02 Thread Ryan Harris
X) as countB) subb ON (suba.X = subb.X) From: Frank Luo [mailto:j...@merkleinc.com] Sent: Wednesday, December 02, 2015 2:43 PM To: user@hive.apache.org Subject: RE: how to get counts as a byproduct of a query I might not illustrate the problem well. Let’s try on a sample. Here is what I have: Ta

RE: how to get counts as a byproduct of a query

2015-12-02 Thread Frank Luo
A and B. I am not able to write a query to do both. From: Jörn Franke [mailto:jornfra...@gmail.com] Sent: Wednesday, December 02, 2015 3:22 PM To: user@hive.apache.org Subject: Re: how to get counts as a byproduct of a query I am not sure if I understand, but why this should not be possible

Re: how to get counts as a byproduct of a query

2015-12-02 Thread Jörn Franke
nt: Tuesday, December 01, 2015 10:40 PM > To: user@hive.apache.org > Subject: how to get counts as a byproduct of a query > > Very often I need to run a query against a table(s), then collect some > counts. I am wondering if there is a way to kill two birds by scanning the >

RE: how to get counts as a byproduct of a query

2015-12-02 Thread Ryan Harris
https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-MULTITABLEINSERT From: Frank Luo [mailto:j...@merkleinc.com] Sent: Wednesday, December 02, 2015 1:26 PM To: user@hive.apache.org Subject: RE: how to get counts as a byproduct of a query Didn’t get any response, so

RE: how to get counts as a byproduct of a query

2015-12-02 Thread Frank Luo
Didn’t get any response, so trying one more time. I cannot believe I am the only one facing the problem. From: Frank Luo Sent: Tuesday, December 01, 2015 10:40 PM To: user@hive.apache.org Subject: how to get counts as a byproduct of a query Very often I need to run a query against a table(s

how to get counts as a byproduct of a query

2015-12-01 Thread Frank Luo
Very often I need to run a query against a table(s), then collect some counts. I am wondering if there is a way to kill two birds by scanning the table once. (I don’t mind to save the counts as a separate file or something like that) For example, I got a table A and B. I need to do an inner join