Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9FA96200C40 for ; Thu, 9 Mar 2017 02:50:22 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9E3E1160B86; Thu, 9 Mar 2017 01:50:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BCAEC160B83 for ; Thu, 9 Mar 2017 02:50:21 +0100 (CET) Received: (qmail 87933 invoked by uid 500); 9 Mar 2017 01:50:20 -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 87923 invoked by uid 99); 9 Mar 2017 01:50:20 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Mar 2017 01:50:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0261BC3B51 for ; Thu, 9 Mar 2017 01:50:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.303 X-Spam-Level: ** X-Spam-Status: No, score=2.303 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.096, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id a1N75-8J_zEX for ; Thu, 9 Mar 2017 01:50:18 +0000 (UTC) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id A6DA460DFC for ; Thu, 9 Mar 2017 01:50:17 +0000 (UTC) Received: by mail-oi0-f44.google.com with SMTP id 62so29680685oih.2 for ; Wed, 08 Mar 2017 17:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=+585BvSnuEHcSEH/B5rGSwGCBgm182QbB4lOpHNDPwQ=; b=k3D7ERw/G2Y6B0NafwtcQBjQGLZIJRFIfxNhqfvushAEuOmCA41D3YIdA6C0eUfMU9 863ikupy/UniWUlvyzXUPxbOApT7Pt0VHEVDu+eGz8gX0ap5ywxvwantCHNhO3KzimNF //Wx2jnzmfL58Rq//uAIsJYFrH8qggimNyfhKvzbOok+jXGTj7gkrIypnvptZ1D56hug /SuE5vDqa9Fy2m4UPBTt/z5uoQllDVr+PCbu7weqlp2zcpMSiNy8Gw9P4nJGiVlap9o9 nvL9h2OpJvQYBfo6K+qw4WWlA2+q8tu6GB2tL5GtGj08wedsmWj9/AzNmJYVFeCMB/B3 g7LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=+585BvSnuEHcSEH/B5rGSwGCBgm182QbB4lOpHNDPwQ=; b=Jo0khMWkRQY1l9cWe5CJa1Qv505bh+zj+egoFHBfaWumUBsMuNp3z8ZT5QoN5X8/JS fy1+Q3f7YfBaho98JDmBbwn3XUIZfV0wsta53MdjOochXS7789YQLayBOmoK0o2S9yfB 3lvEut/mdCAVdM9c7Folnemfl//YGjxxLngyw707HSWsE8TMBwxKuwR0NFpcvUlSFKny EwLuRYUFyLCaskDieFYEhbq4uwxpsP6nHia+rAyHAU6ypEB6c+9PXLsRUiqgKQOvRaKE fKOLavopjilqpESxWYO1CEQFIOHlGcFM1P4nNFkxNnBnTolGv3sFBuxXQKVamA7DUt6H Vpgw== X-Gm-Message-State: AMke39kH4HisJRR3kPjWOIpVF/iNg7IZ7ed2uo/5D/WjZU4hIOV5D4oaNwDTEXRSfb0gL+3hfmlEB6D21VHv9g== X-Received: by 10.202.87.78 with SMTP id l75mr4862806oib.213.1489024210684; Wed, 08 Mar 2017 17:50:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.8.228 with HTTP; Wed, 8 Mar 2017 17:49:50 -0800 (PST) In-Reply-To: References: From: "Pushkar.Gujar" Date: Wed, 8 Mar 2017 20:49:50 -0500 Message-ID: Subject: Re: Missing column headers from S3 file To: user@hive.apache.org Content-Type: multipart/alternative; boundary=001a113ad44823d308054a427796 archived-at: Thu, 09 Mar 2017 01:50:22 -0000 --001a113ad44823d308054a427796 Content-Type: text/plain; charset=UTF-8 if you were running CTAS command from hive CLI, you might have noticed that headers get printed in CLI once the query execution is completed. I think the property hive.cli.print.header is there to only print headers only in cli. Not sure about S3, but I tried below which worked perfectly hive -e "set hive.cli.print.header=true; create table....." >> output.txt Thank you, *Pushkar Gujar* On Wed, Mar 8, 2017 at 6:47 PM, Punit Shetty wrote: > Hi, > > I'm trying to get the column headers into a S3 file. > > When I run this on the hive command line: > set hive.cli.print.header=true; > select * from abc; > > Things work fine, I'm able to see the column headers with the table data > on the console. > > But my query is, when I try something like this: > set hive.cli.print.header=true; > CREATE TABLE test123 ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LINES > TERMINATED BY '\n' STORED AS TEXTFILE LOCATION 's3://somelocation' AS > select * abc; > > The column headers are missing from the S3 file. > > Is this the expected behaviour or am I missing something? > > Thanks, > Punit > --001a113ad44823d308054a427796 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
if you were running CTAS command from = hive CLI, you might have noticed that headers get printed in CLI once the q= uery execution is completed. I think the property hive.cli.print.header is = there to only print headers only in cli.

Not sure about S3, but I tried below which worked perf= ectly=C2=A0

hive -e = "set hive.cli.print.header=3Dtrue; create table....." >> ou= tput.txt


Thank you,
Pushkar Gujar


On Wed, Mar 8, 2017 at 6:47 PM, Punit Shetty= <punitshetty30@gmail.com> wrote:
Hi,<= div style=3D"font-size:12.8px">
I&= #39;m trying to get the column headers into a S3 file.

When I run this = on the hive command line:
set hive.cli= .print.header=3Dtrue;
select * from ab= c;

Things work fine, I'm able to see the column headers with the ta= ble data on the console.

But my query is, when I try something like thi= s:
set hive.cli.print.header=3Dtr= ue;
CREATE TABLE test123 ROW FORMAT DELIMITED FIELDS TERMINATED B= Y '\t' LINES TERMINATED BY '\n' STORED AS TEXTFILE LOCATION= 's3://somelocation' AS
select * abc;

The colum= n headers are missing from the S3 file.

Is this the expected behaviour = or am I missing something?

<= div style=3D"font-size:12.8px">Thanks,
Punit

--001a113ad44823d308054a427796--