You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "Chinmay Kulkarni (Jira)" <ji...@apache.org> on 2019/10/16 00:36:00 UTC

[jira] [Commented] (PHOENIX-5529) Creating a grand-child view on a table with an index fails

    [ https://issues.apache.org/jira/browse/PHOENIX-5529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16952405#comment-16952405 ] 

Chinmay Kulkarni commented on PHOENIX-5529:
-------------------------------------------

Perhaps similar to [PHOENIX-5322|https://issues.apache.org/jira/browse/PHOENIX-5322]. FYI [~kozdemir] [~gjacoby]

> Creating a grand-child view on a table with an index fails
> ----------------------------------------------------------
>
>                 Key: PHOENIX-5529
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5529
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.15.0
>            Reporter: Chinmay Kulkarni
>            Priority: Major
>
> Steps to reproduce:
> * Build the latest Phoenix jar from the 4.x-HBase-1.3 branch.
> * Start HBase 1.3 server with above Phoenix jar in the classpath
> * Connect with a Phoenix client with above jar in classpath. From SQLLine:
> {code:sql}
> CREATE TABLE IF NOT EXISTS Z_BASE_TABLE (ID INTEGER NOT NULL PRIMARY KEY, HOST VARCHAR(10), FLAG BOOLEAN);
> CREATE VIEW Z_VIEW1 (col1 INTEGER, col2 INTEGER, col3 INTEGER, col4 INTEGER, col5 INTEGER) AS SELECT * FROM Z_BASE_TABLE WHERE ID>10;
> CREATE INDEX Z_INDEX ON Z_BASE_TABLE(HOST);
> CREATE VIEW GRAND_CHILD1 AS SELECT * FROM Z_VIEW1 WHERE col1 > 2;
> {code}
> The last step fails with the following exception:
> {code:java}
> Error: ERROR 504 (42703): Undefined column. columnName=Z_VIEW1#Z_INDEX.0:COL1 (state=42703,code=504)
> org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): Undefined column. columnName=Z_VIEW1#Z_INDEX.0:COL1
> 	at org.apache.phoenix.schema.PTableImpl.getColumnForColumnName(PTableImpl.java:1076)
> 	at org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.resolveColumn(FromCompiler.java:528)
> 	at org.apache.phoenix.compile.ExpressionCompiler.resolveColumn(ExpressionCompiler.java:368)
> 	at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.resolveColumn(WhereCompiler.java:191)
> 	at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.visit(WhereCompiler.java:177)
> 	at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.visit(WhereCompiler.java:164)
> 	at org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:56)
> 	at org.apache.phoenix.parse.CompoundParseNode.acceptChildren(CompoundParseNode.java:64)
> 	at org.apache.phoenix.parse.CastParseNode.accept(CastParseNode.java:60)
> 	at org.apache.phoenix.parse.CompoundParseNode.acceptChildren(CompoundParseNode.java:64)
> 	at org.apache.phoenix.parse.ComparisonParseNode.accept(ComparisonParseNode.java:45)
> 	at org.apache.phoenix.parse.CompoundParseNode.acceptChildren(CompoundParseNode.java:64)
> 	at org.apache.phoenix.parse.AndParseNode.accept(AndParseNode.java:47)
> 	at org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:94)
> 	at org.apache.phoenix.util.IndexUtil.rewriteViewStatement(IndexUtil.java:549)
> 	at org.apache.phoenix.util.ViewUtil.addIndexesFromParent(ViewUtil.java:283)
> 	at org.apache.phoenix.util.ViewUtil.addDerivedColumnsAndIndexesFromParent(ViewUtil.java:531)
> 	at org.apache.phoenix.schema.MetaDataClient.addColumnsAndIndexesFromAncestors(MetaDataClient.java:859)
> 	at org.apache.phoenix.schema.MetaDataClient.addTableToCache(MetaDataClient.java:4456)
> 	at org.apache.phoenix.schema.MetaDataClient.addTableToCache(MetaDataClient.java:4452)
> 	at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:3004)
> 	at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:1049)
> 	at org.apache.phoenix.compile.CreateTableCompiler$1.execute(CreateTableCompiler.java:217)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:411)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:394)
> 	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:393)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:381)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1843)
> 	at sqlline.Commands.execute(Commands.java:814)
> 	at sqlline.Commands.sql(Commands.java:754)
> 	at sqlline.SqlLine.dispatch(SqlLine.java:646)
> 	at sqlline.SqlLine.begin(SqlLine.java:510)
> 	at sqlline.SqlLine.start(SqlLine.java:233)
> 	at sqlline.SqlLine.main(SqlLine.java:175)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)