From dev-return-51845-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Fri May 18 04:09:03 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 64094180634 for ; Fri, 18 May 2018 04:09:03 +0200 (CEST) Received: (qmail 6976 invoked by uid 500); 18 May 2018 02:09:02 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 6965 invoked by uid 99); 18 May 2018 02:09:02 -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; Fri, 18 May 2018 02:09:02 +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 AE448CCBBB for ; Fri, 18 May 2018 02:09:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, 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 nfjAgNKv_740 for ; Fri, 18 May 2018 02:09: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 B757D5F21E for ; Fri, 18 May 2018 02:09: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 47B02E00B8 for ; Fri, 18 May 2018 02:09: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 087D32179F for ; Fri, 18 May 2018 02:09:00 +0000 (UTC) Date: Fri, 18 May 2018 02:09:00 +0000 (UTC) From: "Chinmay Kulkarni (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (PHOENIX-4743) ALTER TABLE ADD COLUMN for global index should not modify HBase metadata if failed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Chinmay Kulkarni created PHOENIX-4743: ----------------------------------------- Summary: ALTER TABLE ADD COLUMN for global index should not mo= dify HBase metadata if failed Key: PHOENIX-4743 URL: https://issues.apache.org/jira/browse/PHOENIX-4743 Project: Phoenix Issue Type: Bug Reporter: Chinmay Kulkarni When you issue an "ALTER TABLE" for a global index to add a column, Phoenix= throws a SQLException, but the HBase metadata for the global index table i= s still modified. Steps to reproduce: # Create the base data table:=C2=A0 {code:java} create table if not exists z_base_table (id INTEGER not null primary key, h= ost VARCHAR(10), flag boolean);{code} # Create a global index on top of this table: {code:java} create index global_z_index on z_base_table(HOST);{code} # Alter the global index table to add a column: {code:java} alter table global_z_index add cf1.age INTEGER;{code} This will throw an exception in Phoenix, but HBase metadata for the global = index table is still modified. Stack trace: =C2=A0 {noformat} Error: ERROR 1010 (42M01): Not allowed to mutate table. Cannot add/drop col= umn referenced by VIEW columnName=3DGLOBAL_Z_INDEX (state=3D42M01,code=3D10= 10) java.sql.SQLException: ERROR 1010 (42M01): Not allowed to mutate table. Ca= nnot add/drop column referenced by VIEW columnName=3DGLOBAL_Z_INDEX at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQ= LExceptionCode.java:494) at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExcepti= onInfo.java:150) at org.apache.phoenix.schema.MetaDataClient.processMutationResult(MetaData= Client.java:3049) at org.apache.phoenix.schema.MetaDataClient.addColumn(MetaDataClient.java:= 3503) at org.apache.phoenix.schema.MetaDataClient.addColumn(MetaDataClient.java:= 3210) at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableAddColumnStatement$1= .execute(PhoenixStatement.java:1432) at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:4= 08) at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:3= 91) at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStateme= nt.java:390) at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStateme= nt.java:378) at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:= 1825) at sqlline.Commands.execute(Commands.java:822) at sqlline.Commands.sql(Commands.java:732) at sqlline.SqlLine.dispatch(SqlLine.java:813) at sqlline.SqlLine.begin(SqlLine.java:686) at sqlline.SqlLine.start(SqlLine.java:398) at sqlline.SqlLine.main(SqlLine.java:291{noformat} =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)