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 65CC610917 for ; Wed, 23 Oct 2013 23:54:17 +0000 (UTC) Received: (qmail 48770 invoked by uid 500); 23 Oct 2013 23:54:15 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 48726 invoked by uid 500); 23 Oct 2013 23:54: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 48718 invoked by uid 99); 23 Oct 2013 23:54:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Oct 2013 23:54:15 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of xguo27@gmail.com designates 209.85.223.170 as permitted sender) Received: from [209.85.223.170] (HELO mail-ie0-f170.google.com) (209.85.223.170) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Oct 2013 23:54:10 +0000 Received: by mail-ie0-f170.google.com with SMTP id at1so2685990iec.29 for ; Wed, 23 Oct 2013 16:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=WJ84oSxCYUCj9ofTLwVouCp5vkjc4W90FBdFs1OrpW8=; b=d94Tf9Yx5emw+PQnpHx1I/oAoYBbjspnl2/VQ00Zpfg0SwzxbqmvA5NlwqZkLszWSE 9YzExcRBeZ877onp5CQW3KkYg4+EWb6pkrA5sIPQgks/wt+o89QJPw1hbngkbOOXn3FH 9MCisF6OCjihRHWnRILm91/nfKFxVzkktAKb2vTpswr4pnmKthJrXsSbpyo+ofTj3dRp kAgoSwG5qPEOi8aDlCo/IKCy4JQVOwAMap5Smt2LBJJ7LOkzXOyn3I127JccignQpFH/ xXh7UAQNvjys5G0EHUi7GLmj3RWn5MzPwtt+VpDTz920ajTDoY7lrHLyfNABTjyQsezv UftA== X-Received: by 10.50.55.106 with SMTP id r10mr1942858igp.45.1382572429809; Wed, 23 Oct 2013 16:53:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.96.39 with HTTP; Wed, 23 Oct 2013 16:53:29 -0700 (PDT) From: Xiu Guo Date: Wed, 23 Oct 2013 16:53:29 -0700 Message-ID: Subject: Data file and table def different number of columns To: "user@hive.apache.org" Content-Type: multipart/alternative; boundary=047d7b10ce438e221104e9713ad5 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b10ce438e221104e9713ad5 Content-Type: text/plain; charset=ISO-8859-1 We have a table called employee.dat with below contents: 1,ryan,d'souza,it,20000 2,michael,fernandes,admin,25000 then in Hive, query: create table myTbl (a INT, b STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' TBLPROPERTIES ("serialization.null.format"="\\N"); LOAD DATA LOCAL INPATH "/.../employee.dat" overwrite into table myTbl; when do: select * from myTbl; the result is: 1 ryan 2 michael Is this correct? One of my teammate says if the dat file and table def has different number of columns, NULL values should be in the table. Can someone please confirm which one is expected behavior? Thanks, --047d7b10ce438e221104e9713ad5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
We have a tab= le called employee.dat with below contents:

1,ryan,d'souza,it,20000
2,mi= chael,fernandes,admin,25000

then in Hive, query:

create table myTbl=A0(a INT, b STRING)
ROW FORMAT DELIMITED
FIELDS TERMINAT= ED BY ','
LINES TERMINATED BY '\n'
TBLPROPERTIES=20 ("serialization.null.format"=3D"\\N");

LOAD DAT= A LOCAL INPATH "/.../employee.dat" overwrite into table myTbl;
when do:
select * from myTbl;

<= span class=3D"" style=3D"display:block" tabindex=3D"0">the result is:=

1 ryan
2 michael

Is this correct? One = of my teammate says if the dat file and table def has different number of c= olumns, NULL values should be in the table.

Can someone please confirm which one is expected behavior?
=
Thanks,
--047d7b10ce438e221104e9713ad5--