[
https://issues.apache.org/jira/browse/PHOENIX-1616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14300004#comment-14300004
]
James Taylor commented on PHOENIX-1616:
---------------------------------------
No problem, [~maryannxue]. I should have given you a bit more context. There's
no bug/issue with joins and case insensitivity. The problem is with views and
soon-to-be functional indexes. They need to be able to roundtrip an expression
from String->ParseNode->Expression->String. Because we weren't
capturing/remembering on the ParseNode that a column was referenced in a case
sensitive manner, this would break down. This patch fixes that. However, it
rippled over into join-land, with the explain plan, as now columns referenced
in a case sensitive manner will be double quoted. Thus, some of the explain
plans were updated accordingly.
Does this seem ok to you?
> 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: 4.3, 3.3
>
> Attachments: PHOENIX-1616.patch, PHOENIX-1616_3.0.patch,
> PHOENIX-1616_3.0_v2.patch, PHOENIX-1616_v2.patch
>
>
> If I create a 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"
> Throws the following exception
> 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)
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)