Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-1616

Creating a View with a case sensitive column name does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0, 4.0.0
    • 4.3.0, 3.3.0
    • None
    • None

    Description

      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)

      Attachments

        1. PHOENIX-1616.patch
          85 kB
          Thomas D'Silva
        2. PHOENIX-1616_v2.patch
          84 kB
          James R. Taylor
        3. PHOENIX-1616_3.0.patch
          67 kB
          James R. Taylor
        4. PHOENIX-1616_3.0_v2.patch
          68 kB
          James R. Taylor

        Activity

          People

            tdsilva Thomas D'Silva
            tdsilva Thomas D'Silva
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: