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 CEF7F200D30 for ; Mon, 30 Oct 2017 23:30:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CD955160BE4; Mon, 30 Oct 2017 22:30:01 +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 1EDAF1609D5 for ; Mon, 30 Oct 2017 23:30:00 +0100 (CET) Received: (qmail 18625 invoked by uid 500); 30 Oct 2017 22:29:59 -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 18615 invoked by uid 99); 30 Oct 2017 22:29:59 -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; Mon, 30 Oct 2017 22:29:59 +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 DBD4DCE0FD for ; Mon, 30 Oct 2017 22:29:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.151 X-Spam-Level: X-Spam-Status: No, score=-0.151 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, 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 lqUi8Qx8L830 for ; Mon, 30 Oct 2017 22:29:58 +0000 (UTC) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com [209.85.223.179]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 07C0D61166 for ; Mon, 30 Oct 2017 22:29:57 +0000 (UTC) Received: by mail-io0-f179.google.com with SMTP id m16so30802987iod.1 for ; Mon, 30 Oct 2017 15:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=FXtW8rz5rmpEYGgRQYaPDy2thJh0frY7aslMp0GcPZ4=; b=RIvRv5psPtYMSSjs06LTGhLllQvW2uNZGo+3OVuFoqvkQT3B4/RO4E/Nd4UYQVg9zk VBV1hmW4o2rzO5JFGmg0bPweX1fjmOT+e2mdX7jDM0pxSZ5cdMMq8wKju11/rpysWYuT XVJWtSdZq3/uXnKmJ4ZhOA+Osut97GszQpYGJa4A+TRrAEG29STO3y78StS49qYpyK4N ULRI443ckCxGX2uWQJDVB0j/U8yjHr9+OCurkVps89FD0ihtZSpbBvtNEyak2zQLmC7u vPn2ibkg0wFyf6EjjRPCxT0CHK69uCLQ8y+s+y+VAurf9nqVa15fzuaw8a0ZW9hsyCNe K1Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=FXtW8rz5rmpEYGgRQYaPDy2thJh0frY7aslMp0GcPZ4=; b=Uz8xeNGw5V/6Nk7ulwKYfPP9uOykHTTqirRLkS0EzaMGmLhWpo5V64TIMrzFpnVe4A aBkwMK8uvbttORPvkTeujkVGNbpsAAAqpv90iqR60vOLZqdykIknwHuXqS0XgIg1Ov1b 0B6v70A3m/4B/1NncYCmf0RBx5kbsYSu8B6n5cEk1SLgwlLU0PdXURa9QLjTdbHTfmhx BfaGaHp+RoSLCzZZJzBifGmD5xa1JR+zV0pRvC7De0y5Nmwo9/dzFNN4abb5YeVJcr8E V5O+VeK6QFV9SVbBLo2xfKwkDjfwpFAiAZBMHd46S/x8qHOACRlDZNxGAbUWWlVgxM6K F6Hg== X-Gm-Message-State: AMCzsaXXtgAtou6swaMzHUkkmfkxbAeNQmuvBBDAHS1xgKBXg8HxhTyF 2yO3bDn+yMuasggN+NfZJqCFFcEVLqazl/6BO1xRgg== X-Google-Smtp-Source: ABhQp+T7ZnQrawgKW7HVAxJUPWPoG4TSYEd3wlcM1AM38cwOmr2l7oflp4GcIAIrj5lN5yKXHtC/NdgyQQnoUo85SQ4= X-Received: by 10.107.135.202 with SMTP id r71mr12704791ioi.26.1509402597298; Mon, 30 Oct 2017 15:29:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.87.68 with HTTP; Mon, 30 Oct 2017 15:29:54 -0700 (PDT) From: Jiewen Shao Date: Mon, 30 Oct 2017 15:29:54 -0700 Message-ID: Subject: partitioned hive table To: user@hive.apache.org Content-Type: multipart/alternative; boundary="001a113ea5f0a2979d055ccb2d8d" archived-at: Mon, 30 Oct 2017 22:30:02 -0000 --001a113ea5f0a2979d055ccb2d8d Content-Type: text/plain; charset="UTF-8" Hi, I have persisted lots of JSON files on S3 under partitioned directories such as /bucket/table1/dt=2017-10-28/bar=hello/* 1. Now I created a hive table: CREATE EXTERNAL TABLE table1 (.... ) PARTITIONED BY (dt string, bar string) ROW FORMAT serde 'org.apache.hive.hcatalog.data.JsonSerDe' LOCATION 's3://bucket/table1'; 2. Under hive commandline select * from table1; // return nothing 3. INSERT INTO TABLE table1 PARTITION (dt='2017-08-28', bar='hello') select ....; 4. now select * from table1; // return all the data from that partition 5. select count(*) from table1; // returns 1 Can someone explain what did I miss? Thanks a lot! --001a113ea5f0a2979d055ccb2d8d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, I have persisted lots of JSON files on S3 under partit= ioned directories such as /bucket/table1/dt=3D2017-10-28/bar=3Dhello/*
=
1. Now I created a hive table:=C2=A0
CREATE EXTERN= AL TABLE table1 (.... )
PARTITIONED BY (dt string, bar string= ) ROW FORMAT serde 'org.apache.hive.hcatalog.data.JsonSerDe' LOCATI= ON 's3://bucket/table1';

2. Under hive= commandline
select * from table1;=C2=A0 =C2=A0 // return nothing=

3. INSERT INTO TABLE=C2=A0 table1=C2=A0PARTITION = (dt=3D'2017-08-28', bar=3D'hello') select ....;

4. now select * from table1;=C2=A0 =C2=A0 // return all t= he data from that partition

5. select count(*) fro= m table1;=C2=A0 // returns 1

Can someone explain w= hat did=C2=A0 I miss?

Thanks a lot!
--001a113ea5f0a2979d055ccb2d8d--