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 E778A100E9 for ; Thu, 25 Jul 2013 18:09:40 +0000 (UTC) Received: (qmail 61842 invoked by uid 500); 25 Jul 2013 18:09:38 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 61773 invoked by uid 500); 25 Jul 2013 18:09:38 -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 61757 invoked by uid 99); 25 Jul 2013 18:09:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 18:09:35 +0000 X-ASF-Spam-Status: No, hits=2.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLYTO_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.138.229.147] (HELO nm38-vm3.bullet.mail.ne1.yahoo.com) (98.138.229.147) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 18:09:28 +0000 Received: from [98.138.90.50] by nm38.bullet.mail.ne1.yahoo.com with NNFMP; 25 Jul 2013 18:09:07 -0000 Received: from [98.138.101.182] by tm3.bullet.mail.ne1.yahoo.com with NNFMP; 25 Jul 2013 18:09:07 -0000 Received: from [127.0.0.1] by omp1093.mail.ne1.yahoo.com with NNFMP; 25 Jul 2013 18:08:02 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 991420.91985.bm@omp1093.mail.ne1.yahoo.com Received: (qmail 52397 invoked by uid 60001); 25 Jul 2013 18:08:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1374775682; bh=cTDFLXFo7b40mPjJLX2S6YeQxZd5ZkjcAbWXzjYqjI4=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=Z0zONGVq/L9DlKm2OJ/DHxlQhs1vvsq3ukNaEWUYxqjx5/rm6gXJaSeXXiMR+eTR52+XeQX7PqPKwTPAXEbFsZuuksmZkDczpQXiVpMiVpiXTFycHAY+Ty/A5isL62M7hVbQU+leiZ7ym4eKVmjiNrL8HeyRv8wFllT7atR6Yxs= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=moj6MBgtGgDLCxIcw7GBK7ocO/rqgfQlitxLsSuOvkiUm1MNCzIGEs6jTIeiKQph4NYTQ4Jf/NFdzQ80RrdyQz7fvWUjH0ndOYnjnW34LnxO9azmrzCvbWbkKXp6LMkSpRNoW9lq1AjrOUZ1pLOg0CUkRJS9WRt6apxC0UGktc4=; X-YMail-OSG: 55Cc6hUVM1mvPbkomjBaFs.qsvqp6h5SkRhWK4vKqSBK.Xi 71evXQtjND6bYAf01X2aEAApOYerst20wgoQO9LwX2Inl0RVkZsDUNoBLSUl dP_0x7UeZetPaJQZDtG09S3pKxYd78vqDcKUH_09F1I3rqgiUiNgOzyRSJeH rqVoQKk7iEWkBJaqa.H_Y7DuqCoWlKCShSMuE8dPt35ogQFYOjBJWgwJ.KE4 4H7IyPc4L4iMhsyMDEmP5h6xHkQPlzin9MojCNh3UA2eer6JGHIfEcRRz0DG Vpfq__MiN6l3qtQCE8hOv54vzUkVNlZd3LYIioKMa4RmVum05YPp6TjlGt15 Lb9Syix3I7PARQRToctpNrcpYJVXGszLP1Jg_iORl5Q_mKgvfUybCNn3tAJw 9N0N122K9_e5TC.pI2_wKZDnRtXb72Old6FcyhoMESJ6Ivr7E..fwAYxxJzi nV1VeAZWEX0XMwJ8IG6JjOmjFGoDvKwW1RAuB146OggDm Received: from [144.188.31.2] by web122405.mail.ne1.yahoo.com via HTTP; Thu, 25 Jul 2013 11:08:02 PDT X-Rocket-MIMEInfo: 002.001,SGkgQWxsLAoKSSBoYXZlIGEgdGFibGUgaW4gQXBhY2hlIEhpdmUgYW5kIEkgYW0gaW50ZXJlc3RlZCBpbiBhIHNwZWNpZmljIGZpZWxkIG9mIHRoZSB0YWJsZS4gVGFibGUgbmFtZTogVGFibGUxIGFuZCBmaWVsZCBuYW1lIGYxLiBUaGUgZmllbGQgZjEgaXMgb2YgdHlwZSBNQVA8c3RyaW5nLCBzdHJpbmc.LgoKVGhlIHRhYmxlIGlzIGh1Z2UuIEhvdyBjb3VsZCBJIGZpbmQgdGhlIGRpc3RpbmN0IGtleSB2YWx1ZXMgb2YgdGhlIE1BUCB2YXJpYWJsZSBmMSBhYm92ZT8KCkkgdHJpZWQ6CiRoaXZlIC1lICJzZWwBMAEBAQE- X-Mailer: YahooMailWebService/0.8.150.561 Message-ID: <1374775682.51675.YahooMailNeo@web122405.mail.ne1.yahoo.com> Date: Thu, 25 Jul 2013 11:08:02 -0700 (PDT) From: R J Reply-To: R J Subject: Parse MAP viarable Keys in HIVE To: "user@hive.apache.org" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-2030432097-266829463-1374775682=:51675" X-Virus-Checked: Checked by ClamAV on apache.org ---2030432097-266829463-1374775682=:51675 Content-Type: text/plain; charset=us-ascii Hi All, I have a table in Apache Hive and I am interested in a specific field of the table. Table name: Table1 and field name f1. The field f1 is of type MAP. The table is huge. How could I find the distinct key values of the MAP variable f1 above? I tried: $hive -e "select distinct map_keys(f1) from Table1;" $hive -e "select k from Table1 LATERAL VIEW explode(f1) et as k,v;" Each of the above returned syntax error. Could you please help. If the existing values for a few fields of the table ate: I want the return to be: x m p Thanks a lot. ---2030432097-266829463-1374775682=:51675 Content-Type: text/html; charset=us-ascii
Hi All,

I have a table in Apache Hive and I am interested in a specific field of the table. Table name: Table1 and field name f1. The field f1 is of type MAP<string, string>.

The table is huge. How could I find the distinct key values of the MAP variable f1 above?

I tried:
$hive -e "select distinct map_keys(f1) from Table1;"
$hive -e "select k from Table1 LATERAL VIEW explode(f1) et as k,v;"

Each of the above returned syntax error. Could you please help.

If the existing values for a few fields of the table ate:
<x, y>
<x, p>
<m, n>
<empty>
<m, m>
<p, q>

I want the return to be:
x
m
p

Thanks a lot.


---2030432097-266829463-1374775682=:51675--