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 7286B20049B for ; Mon, 14 Aug 2017 18:39:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 70FF816577F; Mon, 14 Aug 2017 16:39:05 +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 8F0C116577D for ; Mon, 14 Aug 2017 18:39:04 +0200 (CEST) Received: (qmail 11772 invoked by uid 500); 14 Aug 2017 16:39:03 -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 11763 invoked by uid 99); 14 Aug 2017 16:39:03 -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; Mon, 14 Aug 2017 16:39:03 +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 28FDCC02A9 for ; Mon, 14 Aug 2017 16:39:03 +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 fzhXvj4K0TMX for ; Mon, 14 Aug 2017 16:39:01 +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 F17955FE3A for ; Mon, 14 Aug 2017 16:39:00 +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 738FCE00A7 for ; Mon, 14 Aug 2017 16:39:00 +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 0EDE521409 for ; Mon, 14 Aug 2017 16:39:00 +0000 (UTC) Date: Mon, 14 Aug 2017 16:39:00 +0000 (UTC) From: "Wang Haihua (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-17309) alter partition onto a table not in current database throw InvalidOperationException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 14 Aug 2017 16:39:05 -0000 [ https://issues.apache.org/jira/browse/HIVE-17309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16125944#comment-16125944 ] Wang Haihua commented on HIVE-17309: ------------------------------------ Seems failed test result is not related with this patch. cc [~pxiong] [~alangates] thanks for review in advance. > alter partition onto a table not in current database throw InvalidOperationException > ------------------------------------------------------------------------------------ > > Key: HIVE-17309 > URL: https://issues.apache.org/jira/browse/HIVE-17309 > Project: Hive > Issue Type: Bug > Components: Query Processor > Affects Versions: 1.2.2, 2.1.1, 2.2.0 > Reporter: Wang Haihua > Assignee: Wang Haihua > Attachments: HIVE-17309.1.patch > > > When executor alter partition onto a table which existed not in current database, InvalidOperationException thrown. > SQL example: > {code} > use default; > ALTER TABLE anotherdb.test_table_for_alter_partition_nocurrentdb partition(ds='haihua001') CHANGE COLUMN a a_new BOOLEAN; > {code} > We see this code in {{DDLTask.java}} potential problem that not transfer the qualified table name with database name when {{db.alterPartitions}} called. > {code} > if (allPartitions == null) { > db.alterTable(alterTbl.getOldName(), tbl, alterTbl.getIsCascade(), alterTbl.getEnvironmentContext()); > } else { > db.alterPartitions(tbl.getTableName(), allPartitions, alterTbl.getEnvironmentContext()); > } > {code} > stacktrace: > {code} > 2017-07-19T11:06:39,639 INFO [main] metastore.HiveMetaStore: New partition values:[2017-07-14] > 2017-07-19T11:06:39,654 ERROR [main] metastore.RetryingHMSHandler: InvalidOperationException(message:alter is not possible) > at org.apache.hadoop.hive.metastore.HiveAlterHandler.alterPartitions(HiveAlterHandler.java:526) > at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.alter_partitions_with_environment_context(HiveMetaStore.java:3560) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:140) > at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:99) > at com.sun.proxy.$Proxy21.alter_partitions_with_environment_context(Unknown Source) > at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_partitions(HiveMetaStoreClient.java:1486) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:154) > at com.sun.proxy.$Proxy22.alter_partitions(Unknown Source) > at org.apache.hadoop.hive.ql.metadata.Hive.alterPartitions(Hive.java:712) > at org.apache.hadoop.hive.ql.exec.DDLTask.alterTable(DDLTask.java:3338) > at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:368) > at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:197) > at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100) > at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2166) > at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1837) > at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1713) > at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1543) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1174) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1164) > at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:232) > at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:183) > at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:399) > at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:776) > at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:714) > at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:641) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.apache.hadoop.util.RunJar.run(RunJar.java:221) > at org.apache.hadoop.util.RunJar.main(RunJar.java:136) > 2017-07-19T11:06:39,669 ERROR [main] exec.DDLTask: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to alter partition. alter is not possible > at org.apache.hadoop.hive.ql.metadata.Hive.alterPartitions(Hive.java:716) > at org.apache.hadoop.hive.ql.exec.DDLTask.alterTable(DDLTask.java:3338) > at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:368) > at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:197) > at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100) > at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2166) > at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1837) > at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1713) > at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1543) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1174) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1164) > at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:232) > at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:183) > at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:399) > at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:776) > at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:714) > at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:641) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.apache.hadoop.util.RunJar.run(RunJar.java:221) > at org.apache.hadoop.util.RunJar.main(RunJar.java:136) > Caused by: InvalidOperationException(message:alter is not possible) > at org.apache.hadoop.hive.metastore.HiveAlterHandler.alterPartitions(HiveAlterHandler.java:526) > at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.alter_partitions_with_environment_context(HiveMetaStore.java:3560) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:140) > at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:99) > at com.sun.proxy.$Proxy21.alter_partitions_with_environment_context(Unknown Source) > at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_partitions(HiveMetaStoreClient.java:1486) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:154) > at com.sun.proxy.$Proxy22.alter_partitions(Unknown Source) > at org.apache.hadoop.hive.ql.metadata.Hive.alterPartitions(Hive.java:712) > ... 22 more > FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter partition. alter is not possible > 2017-07-19T11:06:39,671 ERROR [main] ql.Driver: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter partition. alter is not possible > {code} > Fix proposal is transfer the qualified table name when {{db.alterPartitions}} called. -- This message was sent by Atlassian JIRA (v6.4.14#64029)