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 EF3F7200C47 for ; Thu, 30 Mar 2017 08:59:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EDBE1160B8B; Thu, 30 Mar 2017 06:59:45 +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 42B9B160B78 for ; Thu, 30 Mar 2017 08:59:45 +0200 (CEST) Received: (qmail 40815 invoked by uid 500); 30 Mar 2017 06:59:44 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 40806 invoked by uid 99); 30 Mar 2017 06:59:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Mar 2017 06:59:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id F0589C0D33 for ; Thu, 30 Mar 2017 06:59:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id HM9In7rqrkS1 for ; Thu, 30 Mar 2017 06:59:42 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 52B405FBE4 for ; Thu, 30 Mar 2017 06:59:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CD8ADE05F7 for ; Thu, 30 Mar 2017 06:59:41 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 8AD332416A for ; Thu, 30 Mar 2017 06:59:41 +0000 (UTC) Date: Thu, 30 Mar 2017 06:59:41 +0000 (UTC) From: "Dudu Markovitz (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-16299) In case of partitioned table, MSCK REPAIR TABLE does not do a full validation of a FS paths and in result create false partitions and directories MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 30 Mar 2017 06:59:46 -0000 [ https://issues.apache.org/jira/browse/HIVE-16299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15948517#comment-15948517 ] Dudu Markovitz commented on HIVE-16299: --------------------------------------- Hi 1. The 1st example could be created on hive 1.1.0-cdh5.7.0 but not on Hive 1.2.1000.2.5.3.0-37. The 2nd example could be created on both. 2. I think that a situation where a partition is created built on directories structure and then directories are built based on the partitions that were just added, is not healthy and should be prevented. It would make a lot of sense to validated a complete path and not each directory separately. > In case of partitioned table, MSCK REPAIR TABLE does not do a full validation of a FS paths and in result create false partitions and directories > ------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: HIVE-16299 > URL: https://issues.apache.org/jira/browse/HIVE-16299 > Project: Hive > Issue Type: Bug > Components: Metastore > Affects Versions: storage-2.2.0 > Reporter: Dudu Markovitz > Assignee: Vihang Karajgaonkar > Priority: Minor > > https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java > static String getPartitionName(Path tablePath, Path partitionPath, Set partCols) > ------------------------------------------------------------------------------------ > MSCK REPAIR validates that any sub-directory is in the format col=val and that there is indeed a partition column named "col". > However, there is no validation of the partition column location and as a result false partitions are being created and so are directories that match those partitions. > e.g. 1 > hive> dfs -mkdir -p /user/hive/warehouse/t/a=1/a=2/a=3/b=4/c=5; > hive> create external table t (i int) partitioned by (a int,b int,c int) ; > OK > hive> msck repair table t; > OK > Partitions not in metastore: t:a=1/a=2/a=3/b=4/c=5 > Repair: Added partition to metastore t:a=1/a=2/a=3/b=4/c=5 > Time taken: 0.563 seconds, Fetched: 2 row(s) > hive> show partitions t; > OK > a=3/b=4/c=5 > hive> dfs -ls -R /user/hive/warehouse/t; > drwxr-xr-x - cloudera supergroup 0 2017-03-26 13:07 /user/hive/warehouse/t/a=1 > drwxr-xr-x - cloudera supergroup 0 2017-03-26 13:07 /user/hive/warehouse/t/a=1/a=2 > drwxr-xr-x - cloudera supergroup 0 2017-03-26 13:07 /user/hive/warehouse/t/a=1/a=2/a=3 > drwxr-xr-x - cloudera supergroup 0 2017-03-26 13:07 /user/hive/warehouse/t/a=1/a=2/a=3/b=4 > drwxr-xr-x - cloudera supergroup 0 2017-03-26 13:07 /user/hive/warehouse/t/a=1/a=2/a=3/b=4/c=5 > drwxrwxrwx - cloudera supergroup 0 2017-03-26 13:07 /user/hive/warehouse/t/a=3 > drwxrwxrwx - cloudera supergroup 0 2017-03-26 13:07 /user/hive/warehouse/t/a=3/b=4 > drwxrwxrwx - cloudera supergroup 0 2017-03-26 13:07 /user/hive/warehouse/t/a=3/b=4/c=5 > e.g. 2 > hive> dfs -mkdir -p /user/hive/warehouse/t/c=3/b=2/a=1; > hive> create external table t (i int) partitioned by (a int,b int,c int); > OK > hive> msck repair table t; > OK > Partitions not in metastore: t:c=3/b=2/a=1 > Repair: Added partition to metastore t:c=3/b=2/a=1 > Time taken: 0.512 seconds, Fetched: 2 row(s) > hive> show partitions t; > OK > a=1/b=2/c=3 > hive> dfs -ls -R /user/hive/warehouse/t; > drwxrwxrwx - cloudera supergroup 0 2017-03-26 13:13 /user/hive/warehouse/t/a=1 > drwxrwxrwx - cloudera supergroup 0 2017-03-26 13:13 /user/hive/warehouse/t/a=1/b=2 > drwxrwxrwx - cloudera supergroup 0 2017-03-26 13:13 /user/hive/warehouse/t/a=1/b=2/c=3 > drwxr-xr-x - cloudera supergroup 0 2017-03-26 13:12 /user/hive/warehouse/t/c=3 > drwxr-xr-x - cloudera supergroup 0 2017-03-26 13:12 /user/hive/warehouse/t/c=3/b=2 > drwxr-xr-x - cloudera supergroup 0 2017-03-26 13:12 /user/hive/warehouse/t/c=3/b=2/a=1 -- This message was sent by Atlassian JIRA (v6.3.15#6346)