From issues-return-103612-archive-asf-public=cust-asf.ponee.io@hive.apache.org Wed Jan 31 22:07:07 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 4F665180662 for ; Wed, 31 Jan 2018 22:07:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3EEB3160C56; Wed, 31 Jan 2018 21:07:07 +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 5F583160C2C for ; Wed, 31 Jan 2018 22:07:06 +0100 (CET) Received: (qmail 12515 invoked by uid 500); 31 Jan 2018 21:07:05 -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 12505 invoked by uid 99); 31 Jan 2018 21:07:05 -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; Wed, 31 Jan 2018 21:07:05 +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 21368DBFF9 for ; Wed, 31 Jan 2018 21:07:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -108.31 X-Spam-Level: X-Spam-Status: No, score=-108.31 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_BADIPHTTP=2, NORMAL_HTTP_TO_IP=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled 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 BRR4vjl4WeSy for ; Wed, 31 Jan 2018 21:07:04 +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 C6F465FB04 for ; Wed, 31 Jan 2018 21:07:03 +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 44479E022D for ; Wed, 31 Jan 2018 21:07:03 +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 8047324102 for ; Wed, 31 Jan 2018 21:07:02 +0000 (UTC) Date: Wed, 31 Jan 2018 21:07:02 +0000 (UTC) From: "Hive QA (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-18582) MSCK REPAIR TABLE Throw MetaException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-18582?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1634= 7611#comment-16347611 ]=20 Hive QA commented on HIVE-18582: -------------------------------- Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12908522/HIVE-18582.patch {color:red}ERROR:{color} -1 due to no test(s) being added or modified. {color:red}ERROR:{color} -1 due to 23 failed/errored test(s), 12964 tests e= xecuted *Failed tests:* {noformat} org.apache.hadoop.hive.cli.TestAccumuloCliDriver.testCliDriver[accumulo_que= ries] (batchId=3D240) org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[mapjoin_hook] (batch= Id=3D13) org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[ppd_join5] (batchId= =3D36) org.apache.hadoop.hive.cli.TestEncryptedHDFSCliDriver.testCliDriver[encrypt= ion_move_tbl] (batchId=3D175) org.apache.hadoop.hive.cli.TestMiniLlapCliDriver.testCliDriver[llap_smb] (b= atchId=3D152) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[bucket_= map_join_tez1] (batchId=3D172) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[insert_= values_orig_table_use_metadata] (batchId=3D167) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[llap_ac= id] (batchId=3D171) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[llap_ac= id_fast] (batchId=3D161) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[mergejo= in] (batchId=3D166) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[resourc= eplan] (batchId=3D164) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[sysdb] = (batchId=3D161) org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[vectori= zation_input_format_excludes] (batchId=3D163) org.apache.hadoop.hive.cli.TestSparkCliDriver.testCliDriver[ppd_join5] (bat= chId=3D122) org.apache.hadoop.hive.cli.control.TestDanglingQOuts.checkDanglingQOut (bat= chId=3D221) org.apache.hadoop.hive.metastore.client.TestTablesCreateDropAlterTruncate.t= estAlterTableNullStorageDescriptorInNew[Embedded] (batchId=3D206) org.apache.hadoop.hive.metastore.client.TestTablesList.testListTableNamesBy= FilterNullDatabase[Embedded] (batchId=3D206) org.apache.hadoop.hive.ql.exec.TestOperators.testNoConditionalTaskSizeForLl= ap (batchId=3D282) org.apache.hadoop.hive.ql.io.TestDruidRecordWriter.testWrite (batchId=3D256= ) org.apache.hive.beeline.cli.TestHiveCli.testNoErrorDB (batchId=3D188) org.apache.hive.jdbc.TestSSL.testConnectionMismatch (batchId=3D234) org.apache.hive.jdbc.TestSSL.testConnectionWrongCertCN (batchId=3D234) org.apache.hive.jdbc.TestSSL.testMetastoreConnectionWrongCertCN (batchId=3D= 234) {noformat} Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/8952/testR= eport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/8952/con= sole Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-8952/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.YetusPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 23 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12908522 - PreCommit-HIVE-Build > MSCK REPAIR TABLE Throw MetaException > -------------------------------------- > > Key: HIVE-18582 > URL: https://issues.apache.org/jira/browse/HIVE-18582 > Project: Hive > Issue Type: Bug > Components: Query Planning > Affects Versions: 2.1.1 > Reporter: liubangchen > Assignee: liubangchen > Priority: Major > Attachments: HIVE-18582.patch > > > while executing query=C2=A0MSCK REPAIR TABLE tablename I got Exception: > {code:java} > org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:E= xpected 1 components, got 2 (log_date=3D2015121309/vgameid=3Dlyjt)) > at org.apache.hadoop.hive.ql.exec.DDLTask.msck(DDLTask.java:1847) > at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:402) > at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:197) > at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.jav= a:100) > at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2073) > at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1744) > at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1453) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1171) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1161) > at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:23= 2) > -- > Caused by: MetaException(message:Expected 1 components, got 2 (log_date= =3D2015121309/vgameid=3Dlyjt)) > at org.apache.hadoop.hive.metastore.Warehouse.makeValsFromName(Warehouse.= java:385) > at org.apache.hadoop.hive.ql.exec.DDLTask.msck(DDLTask.java:1845) > {code} > table=C2=A0PARTITIONED by (log_date,vgameid) > The data file on HDFS is: > =C2=A0 > {code:java} > /usr/hive/warehouse/a.db/tablename/log_date=3D2015063023 > drwxr-xr-x - root supergroup 0 2018-01-26 09:41 /usr/hive/warehouse/a.db/= tablename/log_date=3D2015121309/vgameid=3Dlyjt > {code} > The subdir of log_data=3D2015063023 is empty > If i set=C2=A0=C2=A0hive.msck.path.validation=3Dignore Then msck repair t= able will executed ok. > Then I found code like this: > {code:java} > private int msck(Hive db, MsckDesc msckDesc) { > CheckResult result =3D new CheckResult(); > List repairOutput =3D new ArrayList(); > try { > HiveMetaStoreChecker checker =3D new HiveMetaStoreChecker(db); > String[] names =3D Utilities.getDbTableName(msckDesc.getTableName()); > checker.checkMetastore(names[0], names[1], msckDesc.getPartSpecs(), r= esult); > List partsNotInMs =3D result.getPartitio= nsNotInMs(); > if (msckDesc.isRepairPartitions() && !partsNotInMs.isEmpty()) { > //I think bug is here > AbstractList vals =3D null; > String settingStr =3D HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_= MSCK_PATH_VALIDATION); > boolean doValidate =3D !("ignore".equals(settingStr)); > boolean doSkip =3D doValidate && "skip".equals(settingStr); > // The default setting is "throw"; assume doValidate && !doSkip mea= ns throw. > if (doValidate) { > // Validate that we can add partition without escaping. Escaping = was originally intended > // to avoid creating invalid HDFS paths; however, if we escape th= e HDFS path (that we > // deem invalid but HDFS actually supports - it is possible to cr= eate HDFS paths with > // unprintable characters like ASCII 7), metastore will create an= other directory instead > // of the one we are trying to "repair" here. > Iterator iter =3D partsNotInMs.itera= tor(); > while (iter.hasNext()) { > CheckResult.PartitionResult part =3D iter.next(); > try { > vals =3D Warehouse.makeValsFromName(part.getPartitionName(), = vals); > } catch (MetaException ex) { > throw new HiveException(ex); > } > for (String val : vals) { > String escapedPath =3D FileUtils.escapePathName(val); > assert escapedPath !=3D null; > if (escapedPath.equals(val)) continue; > String errorMsg =3D "Repair: Cannot add partition " + msckDes= c.getTableName() > + ':' + part.getPartitionName() + " due to invalid charac= ters in the name"; > if (doSkip) { > repairOutput.add(errorMsg); > iter.remove(); > } else { > throw new HiveException(errorMsg); > } > } > } > } > {code} > I think=C2=A0=C2=A0AbstractList vals =3D null; must placed after= =C2=A0 "while (iter.hasNext()) {" will work ok. > =C2=A0 > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)