[
https://issues.apache.org/jira/browse/PHOENIX-6864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Viraj Jasani updated PHOENIX-6864:
----------------------------------
Fix Version/s: 5.2.0
> create view throwing NPE when referring back to itself
> ------------------------------------------------------
>
> Key: PHOENIX-6864
> URL: https://issues.apache.org/jira/browse/PHOENIX-6864
> Project: Phoenix
> Issue Type: Bug
> Components: core
> Affects Versions: 5.2.0
> Reporter: Istvan Toth
> Assignee: Divneet Kaur
> Priority: Minor
> Fix For: 5.2.0
>
>
> I used the view to be created as the source table name, and I got an NPE.
> Of course the statement does not make sense, but we should throw something
> better than an NPE. (like Table Not Exist)
> {noformat}
> create view v1 as select * from v1 where v1='2000-01-01 01:01:01';
> java.lang.NullPointerException
> at
> org.apache.phoenix.schema.PTableImpl.getColumnForColumnName(PTableImpl.java:1273)
> at
> org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.resolveColumn(FromCompiler.java:533)
> at
> org.apache.phoenix.compile.ExpressionCompiler.resolveColumn(ExpressionCompiler.java:371)
> at
> org.apache.phoenix.compile.CreateTableCompiler$ColumnTrackingExpressionCompiler.resolveColumn(CreateTableCompiler.java:262)
> at
> org.apache.phoenix.compile.ExpressionCompiler.visit(ExpressionCompiler.java:410)
> at
> org.apache.phoenix.compile.ExpressionCompiler.visit(ExpressionCompiler.java:146)
> 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.ComparisonParseNode.accept(ComparisonParseNode.java:45)
> at
> org.apache.phoenix.compile.CreateTableCompiler.compile(CreateTableCompiler.java:151)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateTableStatement.compilePlan(PhoenixStatement.java:1043)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateTableStatement.compilePlan(PhoenixStatement.java:1031)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:538)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:520)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:519)
> at
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:507)
> at
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:2175)
> at sqlline.Commands.executeSingleQuery(Commands.java:1054)
> at sqlline.Commands.execute(Commands.java:1003)
> at sqlline.Commands.sql(Commands.java:967)
> at sqlline.SqlLine.dispatch(SqlLine.java:734)
> at sqlline.SqlLine.begin(SqlLine.java:541)
> at sqlline.SqlLine.start(SqlLine.java:267)
> at sqlline.SqlLine.main(SqlLine.java:206)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)