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 BA218181F5 for ; Fri, 5 Jun 2015 14:44:16 +0000 (UTC) Received: (qmail 8481 invoked by uid 500); 5 Jun 2015 14:44:15 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 8411 invoked by uid 500); 5 Jun 2015 14:44:15 -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 8401 invoked by uid 99); 5 Jun 2015 14:44:15 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Jun 2015 14:44:15 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C14731821FA for ; Fri, 5 Jun 2015 14:44:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.899 X-Spam-Level: ** X-Spam-Status: No, score=2.899 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 4613k8PxRvY0 for ; Fri, 5 Jun 2015 14:44:03 +0000 (UTC) Received: from mail-ie0-f179.google.com (mail-ie0-f179.google.com [209.85.223.179]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 82EA5275E7 for ; Fri, 5 Jun 2015 14:44:03 +0000 (UTC) Received: by ieclw1 with SMTP id lw1so59480923iec.3 for ; Fri, 05 Jun 2015 07:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=pwHHJXKz7X0aIlwvzSzbqGkgAunOQ5K64bJyyPJvFqE=; b=w57dzt/RLvMAg4SZELxncz3amoqkyGkffSsH5h+5yYoYhlkINKVpijhiH4nuJ2zjze 8Y0/DFpowLLXQ9qOOYqa4BLkPIFBIAWEF7VFdEOy3NkPKmTf9HvpQ3AMcTE2VrvBLGG3 irIugat+XWctwHD4Al5iC5YHUOAZKNP/HYxtm2HKWWWsmxADo2TbHfTDHs0k7kBtP53x Ux5ckmeYLVcuRofmUbZel6pr8syzlsNxnJOWBbH3JOWZy6TyoiirjBbR9KIl8h2bcUuU zK2mCARbT2btbu/gofb6tmBAAb4IZ4pinnVmUBjHZ3WoygDUSdYOROz7FIFrcSohCPeD 4ljA== MIME-Version: 1.0 X-Received: by 10.42.99.70 with SMTP id v6mr10368664icn.1.1433515437665; Fri, 05 Jun 2015 07:43:57 -0700 (PDT) Received: by 10.50.138.138 with HTTP; Fri, 5 Jun 2015 07:43:57 -0700 (PDT) In-Reply-To: References: Date: Fri, 5 Jun 2015 10:43:57 -0400 Message-ID: Subject: Re: Reading Json files in hive From: DU DU To: user@hive.apache.org Content-Type: multipart/alternative; boundary=20cf301cc3ae71351b0517c652a3 --20cf301cc3ae71351b0517c652a3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You can use json_tuple which has better performance as I remember as follows. Your table should have single column to keep each line of Json string. select * from json_table lateral view json_tuple(json_table_cloumn, 'columnA') val as columnA ... On Fri, Jun 5, 2015 at 10:38 AM, Wollert, Fabian wrote: > Hey Ayazur, please see here for doc's on how to read JSON in Hive: > > > https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#Langu= ageManualUDF-get_json_object > > Cheers > Fabian > > 2015-06-05 16:30 GMT+02:00 Ayazur Rehman : > >> Hi, >> >> Can someone tell me how to read Json file in hive >> My Hive version is 0.14 >> >> the schema is something like this- >> >> {"columnA": "some_string", "columnB": 227958.0, "columnC": [0.0, 0.0, 0.= 0, 0.0], "columnD": {"some_string":10.0}} >> >> If there is documentation about it, please let me know as well >> >> -- >> Thanking You, >> Ayazur Rehman >> +1 720 917 8540 >> > > > > -- > *Fabian Wollert* > Business Intelligence > > > > *POSTAL ADDRESS* > Zalando SE > 11501 Berlin > > *OFFICE* > Zalando SE > Mollstra=C3=9Fe 1 > 10178 Berlin > Germany > > Phone: +49 30 20968 1819 > Fax: +49 30 27594 693 > E-Mail: fabian.wollert@zalando.de > Web: www.zalando.de > Jobs: jobs.zalando.de > > Zalando SE, Tamara-Danz-Stra=C3=9Fe 1, 10243 Berlin > Company registration: Amtsgericht Charlottenburg, HRB 158855 B > Tax ID: 29/560/00596 * VAT registration number: DE 260543043 > Management Board: Robert Gentz, David Schneider, Rubin Ritter > Chairperson of the Supervisory Board: Cristina Stenbeck > Registered office: Berlinn > --=20 Thanks, Will --20cf301cc3ae71351b0517c652a3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
You can use json_tuple which has better = performance as I remember as follows. Your table should have single column = to keep each line of Json string.

select * from json_table
columnA') val as=C2=A0columnA
...

On Fri, Jun 5, 2015 at 10:3= 8 AM, Wollert, Fabian <fabian.wollert@zalando.de> wr= ote:
Cheers
Fabian

2015-06-05 16:30 = GMT+02:00 Ayazur Rehman <rehman.ayazur90@gmail.com>:=
Hi,=C2=A0

Can someone tell me how to read Json file in hive
My Hive version is 0.14

the schema is som= ething like this-
{"columnA": "some_string=
", "columnB": 227958.0, "columnC": [0.0, 0.0, 0.0,=
 0.0], "columnD": {"some_string":10.0}}
If there is documentation about it, please let me know as well
=

--
Thanking You,
Ayazur= Rehman



--
Fabian Wollert<= /b>
Business Intelligence


<= span style=3D"color:rgb(102,102,102)">POSTAL ADDR= ESS
Zalando SE
11501 Berlin

<= span style=3D"font-family:arial,helvetica,sans-serif">OFFICE
Zalando S= E
Mollstra=C3=9Fe 1
10178 Berlin
Germany

Phone: += 49 30 20968 1819
Fax:=C2=A0=C2=A0 +49 30 27594 693
E-= Mail: fabian= .wollert@zalando.de
Web: www.zalando.de
Jobs: jobs.zalando.de

Zalando SE, Tamara-Danz-Stra= =C3=9Fe 1, 10243 Berlin
Company registration: Amtsgericht Charlottenbur= g, HRB 158855 B
Tax ID: 29/560/00596 * VAT registration number: DE 2605= 43043
Management Board: Robert Gentz, David Schneider, Rubin Ritter
= Chairperson of the Supervisory Board: Cristina Stenbeck=C2=A0
Register= ed office: Berlinn



--
Thanks,
Wil= l
--20cf301cc3ae71351b0517c652a3--