Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9800DD59D for ; Mon, 17 Sep 2012 07:33:51 +0000 (UTC) Received: (qmail 60181 invoked by uid 500); 17 Sep 2012 07:33:49 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 59860 invoked by uid 500); 17 Sep 2012 07:33:46 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 59824 invoked by uid 99); 17 Sep 2012 07:33:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Sep 2012 07:33:44 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of amila.maha@gmail.com designates 209.85.214.176 as permitted sender) Received: from [209.85.214.176] (HELO mail-ob0-f176.google.com) (209.85.214.176) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Sep 2012 07:33:37 +0000 Received: by obbtb18 with SMTP id tb18so11356916obb.35 for ; Mon, 17 Sep 2012 00:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Yjf3RVBe3Hnm7VmZF8Kg9yAwyhJjYHdlMMGFy3C/Hj8=; b=Rn/uZdleha9/h0k1b4UaBr/d9tnZQxa8vSyjgd+QidKgTz191UIFsBh5t1OY+OB7wZ Bbcgp3GUO5iJ//IFpPLGogomo3ZcSfXrt0UEBgynaQwcBhvu2O1Dpf2i87Sk0eRWDhFW 7GBK6qWBLazoLtwRAcidPuK41/U1H48C1lBDUo6iknKliL171ihQdeSw1Rh9bt1O4MR3 Rd8Perz2pJ0kXkrRuCM/x+CF/akRxc124j/rba3yKMWfBh7zjqmL4OzEKjkw9lNjAUtF Fz8QUXfsVFmiMw99X60hVgW/euQ7ESb1wpxoSZTswGyESyX8Gk9uQ/0dS3ur8NsNSsl+ Fm+g== MIME-Version: 1.0 Received: by 10.60.26.133 with SMTP id l5mr10873431oeg.60.1347867196157; Mon, 17 Sep 2012 00:33:16 -0700 (PDT) Received: by 10.76.92.66 with HTTP; Mon, 17 Sep 2012 00:33:16 -0700 (PDT) Date: Mon, 17 Sep 2012 13:03:16 +0530 Message-ID: Subject: Does hive support nested queries? From: Amila Maha Arachchi To: user@hive.apache.org Content-Type: multipart/alternative; boundary=e89a8fb206b66e6d3604c9e0c97e --e89a8fb206b66e6d3604c9e0c97e Content-Type: text/plain; charset=ISO-8859-1 Hi folks, I want to provide the output of a select query to a where clause of another query as shown below. select * from TableA where TA_timestamp > (select timestmp from TableB where id="hourDim") Is this possible in hive? When I try to execute this I get the following exception. If this is not possible, is there another way to achieve this? org.apache.hadoop.hive.ql.parse.ParseException: line 1:43 cannot recognize input near 'select' 'timestmp' 'from' in expression specification at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:438) at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:417) at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:337) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:889) at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.execute(HiveServer.java:201) at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:187) at org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl$ScriptCallable.call(HiveExecutorServiceImpl.java:323) at org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl$ScriptCallable.call(HiveExecutorServiceImpl.java:224) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Thanks in advance. Amila. --e89a8fb206b66e6d3604c9e0c97e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi folks,

I want to provide the output of a select query= to a where clause of another query as shown below.

select *=A0
from TableA=A0
where TA_timestamp > (s= elect timestmp from TableB where id=3D"hourDim")=A0

Is this possible in hive? When I try to execute this I = get the following exception.

If this is not possib= le, is there another way to achieve this?

org.apache.hadoop.hive.ql.parse.ParseException: line 1:43 cannot recognize = input near 'select' 'timestmp' 'from' in expression= specification

at org.apache.hadoop.hive.ql.parse.ParseDrive= r.parse(ParseDriver.java:438)
at or= g.apache.hadoop.hive.ql.Driver.compile(Driver.java:417)
at org.apache.hadoo= p.hive.ql.Driver.compile(Driver.java:337)
at or= g.apache.hadoop.hive.ql.Driver.run(Driver.java:889)
at org.apache.hadoop.= hive.service.HiveServer$HiveServerHandler.execute(HiveServer.java:201)
at or= g.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:187= )
at org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl$ScriptCall= able.call(HiveExecutorServiceImpl.java:323)
at or= g.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl$ScriptCallable.ca= ll(HiveExecutorServiceImpl.java:224)
at java.util.concurrent.FutureTask$Syn= c.innerRun(FutureTask.java:303)
at ja= va.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurr= ent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at ja= va.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:90= 8)
at java.lang.Thread.run(Thread.java:662)

Thanks in advance.

Amila= .

--e89a8fb206b66e6d3604c9e0c97e--