[jira] [Updated] (PHOENIX-4743) ALTER TABLE ADD COLUMN for global index should not modify HBase metadata if failed

2019-08-23 Thread Sandeep Pal (Jira)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-4743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sandeep Pal updated PHOENIX-4743:
-
Attachment: (was: PHOENIX-4743.v1.patch)

> 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
>Assignee: Sandeep Pal
>Priority: Major
>  Labels: phoenix-hardening
> Attachments: PHOENIX-4743.patch
>
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> 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 is 
> still modified.
> Steps to reproduce:
>  * Create the base data table: 
> {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: 
> {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 
> column referenced by VIEW columnName=GLOBAL_Z_INDEX (state=42M01,code=1010)
>  java.sql.SQLException: ERROR 1010 (42M01): Not allowed to mutate table. 
> Cannot add/drop column referenced by VIEW columnName=GLOBAL_Z_INDEX
>  at 
> org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:494)
>  at 
> org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:150)
>  at 
> org.apache.phoenix.schema.MetaDataClient.processMutationResult(MetaDataClient.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: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(PhoenixStatement.java:390)
>  at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.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}
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Updated] (PHOENIX-4743) ALTER TABLE ADD COLUMN for global index should not modify HBase metadata if failed

2019-08-23 Thread Sandeep Pal (Jira)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-4743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sandeep Pal updated PHOENIX-4743:
-
Attachment: PHOENIX-4743.v1.patch

> 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
>Assignee: Sandeep Pal
>Priority: Major
>  Labels: phoenix-hardening
> Attachments: PHOENIX-4743.patch, PHOENIX-4743.v1.patch
>
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> 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 is 
> still modified.
> Steps to reproduce:
>  * Create the base data table: 
> {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: 
> {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 
> column referenced by VIEW columnName=GLOBAL_Z_INDEX (state=42M01,code=1010)
>  java.sql.SQLException: ERROR 1010 (42M01): Not allowed to mutate table. 
> Cannot add/drop column referenced by VIEW columnName=GLOBAL_Z_INDEX
>  at 
> org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:494)
>  at 
> org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:150)
>  at 
> org.apache.phoenix.schema.MetaDataClient.processMutationResult(MetaDataClient.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: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(PhoenixStatement.java:390)
>  at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.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}
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


Re: [Question] Apache Calcite integration

2019-08-23 Thread James Taylor
To add to what Josh mentioned, the biggest hurdle was getting
Phoenix+Calcite to function *exactly* the same as current Phoenix. Without
this, it would be difficult to get users to migrate and it was clear we
didn't have the bandwidth to maintain two different code bases. If Phoenix
was being started from scratch, I'd definitely advocate that it be build it
on top of Calcite.


On Thu, Aug 22, 2019 at 8:18 AM Josh Elser  wrote:

> No, the effort has effectively stalled.
>
> It was a significant undertaking to get to where the Calcite integration
> was left, but, more importantly, required significantly more efforts to
> complete it than were available.
>
> I would assume that there is more that what exists today would still be
> generally applicable, but would require efforts to rebase.
>
> On 8/20/19 6:44 AM, Павлухин Иван wrote:
> > Hi Phoenix developers,
> >
> > It would be really great if you can shed a light on a current state of
> > Calcite integration in Phoenix.
> >
> > Currently we are considering Calcite for a new SQL engine in Apache
> > Ignite. And I feel that Phoenix experience might be extremely
> > relevant. I found that a great effort was put on Calcite integration
> > by Phoenix developers, I found a JIRA issue [1] and a related git
> > branch. But as I understood it was not integrated into master branch.
> > So, the questions:
> > 1. Is there an active development of Calcite integration? Otherwise
> > why was it stopped?
> > 2. Are there any blockers for integrating Calcite? Or any significant
> > downsides? (From the first glance Calcite looks as the best library
> > for implementing SQL in a system written in Java).
> >
> > Thank you in advance!
> >
> > [1] https://issues.apache.org/jira/browse/PHOENIX-1488
> >
>