Thomas D'Silva created PHOENIX-1616:
---------------------------------------
Summary: Creating a View with a case sensitive column name does
not work
Key: PHOENIX-1616
URL: https://issues.apache.org/jira/browse/PHOENIX-1616
Project: Phoenix
Issue Type: Bug
Affects Versions: 3.0.0, 4.0.0, 5.0.0
Reporter: Thomas D'Silva
Assignee: Thomas D'Silva
Fix For: 3.0.0, 4.0.0, 5.0.0
If I create view that refers to a case sensitive column, the case sensitivity
is not respected.
Example
CREATE TABLE t (\"k\" INTEGER NOT NULL PRIMARY KEY, v1 DATE)
CREATE VIEW v (v VARCHAR) AS SELECT * FROM t WHERE \"k\" > 5
"SELECT \"k\" FROM v"
org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): Undefined
column. columnName=K
at org.apache.phoenix.schema.PTableImpl.getColumn(PTableImpl.java:571)
at
org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.resolveColumn(FromCompiler.java:305)
at
org.apache.phoenix.compile.ExpressionCompiler.resolveColumn(ExpressionCompiler.java:344)
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.ExpressionCompiler.visit(ExpressionCompiler.java:1)
at
org.apache.phoenix.parse.ColumnParseNode.accept(ColumnParseNode.java:50)
at
org.apache.phoenix.parse.CompoundParseNode.acceptChildren(CompoundParseNode.java:63)
at
org.apache.phoenix.parse.ComparisonParseNode.accept(ComparisonParseNode.java:43)
at
org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:139)
at
org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:100)
at
org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:487)
at
org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:447)
at
org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:154)
at
org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:330)
at
org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1)
at
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:229)
at
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:1)
at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
at
org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:224)
at
org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:1038)
at
org.apache.phoenix.end2end.ViewIT.testReadOnlyViewWithCaseSensitiveColumnNames(ViewIT.java:266)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)