From dev-return-51846-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Fri May 18 04:11:06 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 07DE318076D for ; Fri, 18 May 2018 04:11:05 +0200 (CEST) Received: (qmail 10400 invoked by uid 500); 18 May 2018 02:11:04 -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 10191 invoked by uid 99); 18 May 2018 02:11:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2018 02:11:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A6AFE180635 for ; Fri, 18 May 2018 02:11:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, 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-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id nK5ILtq_bYes for ; Fri, 18 May 2018 02:11:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 3F1155F5B1 for ; Fri, 18 May 2018 02:11:01 +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 69C11E00B8 for ; Fri, 18 May 2018 02:11: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 1DB9521298 for ; Fri, 18 May 2018 02:11:00 +0000 (UTC) Date: Fri, 18 May 2018 02:11:00 +0000 (UTC) From: "Chinmay Kulkarni (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (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 [ https://issues.apache.org/jira/browse/PHOENIX-4743?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chinmay Kulkarni updated PHOENIX-4743: -------------------------------------- Description:=20 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:=C2=A0 {code:java} create index global_z_index on z_base_table(HOST);{code} # Add a column to the global index table: {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: {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 was: 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 > ALTER TABLE ADD COLUMN for global index should not modify HBase metadata = if failed > -------------------------------------------------------------------------= --------- > > Key: PHOENIX-4743 > URL: https://issues.apache.org/jira/browse/PHOENIX-4743 > Project: Phoenix > Issue Type: Bug > Reporter: Chinmay Kulkarni > Priority: Major > > When you issue an "ALTER TABLE" for a global index to add a column, Phoen= ix throws a SQLException, but the HBase metadata for the global index table= is 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,= host VARCHAR(10), flag boolean);{code} > # Create a global index on top of this table:=C2=A0 > {code:java} > create index global_z_index on z_base_table(HOST);{code} > # Add a column to the global index table: > {code:java} > alter table global_z_index add cf1.age INTEGER;{code} > This will throw an exception in Phoenix, but HBase metadata for the globa= l index table is still modified. Stack trace: > {noformat} > Error: ERROR 1010 (42M01): Not allowed to mutate table. Cannot add/drop c= olumn referenced by VIEW columnName=3DGLOBAL_Z_INDEX (state=3D42M01,code=3D= 1010) > java.sql.SQLException: ERROR 1010 (42M01): Not allowed to mutate table. = Cannot add/drop column referenced by VIEW columnName=3DGLOBAL_Z_INDEX > at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(= SQLExceptionCode.java:494) > at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExcep= tionInfo.java:150) > at org.apache.phoenix.schema.MetaDataClient.processMutationResult(MetaDa= taClient.java:3049) > at org.apache.phoenix.schema.MetaDataClient.addColumn(MetaDataClient.jav= a:3503) > at org.apache.phoenix.schema.MetaDataClient.addColumn(MetaDataClient.jav= a:3210) > at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableAddColumnStatement= $1.execute(PhoenixStatement.java:1432) > at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java= :408) > at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java= :391) > at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) > at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixState= ment.java:390) > at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixState= ment.java:378) > at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.jav= a: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)