You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2016/05/14 01:25:12 UTC

[jira] [Updated] (PHOENIX-2882) NPE during View creation for table with secondary index

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

James Taylor updated PHOENIX-2882:
----------------------------------
    Fix Version/s: 4.8.0

> NPE during View creation for table with secondary index 
> --------------------------------------------------------
>
>                 Key: PHOENIX-2882
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2882
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Sergey Soldatov
>             Fix For: 4.8.0
>
>
> A simple test case:
> {noformat}
> create table test (id integer primary key, i1 integer, i2 integer);
> create index i1 on test (i1);
> create view v1 as select * from test where i2 <10;
> {noformat}
> the thrown exception:
> {noformat}
> org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): Undefined column. columnName=0:I2
> 	at org.apache.phoenix.schema.PTableImpl.getColumn(PTableImpl.java:692)
> 	at org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.resolveColumn(FromCompiler.java:444)
> 	at org.apache.phoenix.compile.ExpressionCompiler.resolveColumn(ExpressionCompiler.java:366)
> 	at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.resolveColumn(WhereCompiler.java:181)
> 	at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.visit(WhereCompiler.java:169)
> 	at org.apache.phoenix.compile.WhereCompiler$WhereExpressionCompiler.visit(WhereCompiler.java:156)
> 	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.compile.WhereCompiler.compile(WhereCompiler.java:86)
> 	at org.apache.phoenix.util.IndexUtil.rewriteViewStatement(IndexUtil.java:494)
> 	at org.apache.phoenix.schema.MetaDataClient.addIndexesFromPhysicalTable(MetaDataClient.java:739)
> 	at org.apache.phoenix.schema.MetaDataClient.addTableToCache(MetaDataClient.java:3418)
> 	at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:2279)
> 	at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:866)
> 	at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:183)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:343)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:331)
> 	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:330)
> {noformat}
> View created, but any select using view cause a similar exception



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)