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

Select query from tenant owned view fails if using 4.16 client and 5.1 server.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Resolved
    • 5.1.0
    • 5.2.0, 5.1.3
    • core
    • None

    Description

      Select query from tenant owned view fails if using 4.16 client and 5.1 server.

      Steps to reproduce:

      1. Create table (in this case we are creating T1)
      2. Create an index on that table (I1)
      3. Create a tenant view on the table (V1) (It doesn't need to be tenant view, verified that global view also fails)
      4. Run the following query: SELECT * FROM V1

       

      This fails with the following exception:

      0: jdbc:phoenix:localhost> select * V1;
       
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
          at java.lang.String.substring(String.java:1967)
          at org.apache.phoenix.util.IndexUtil.getDataColumnFamilyName(IndexUtil.java:188)
          at org.apache.phoenix.util.IndexUtil.getCaseSensitiveDataColumnFullName(IndexUtil.java:200)
          at org.apache.phoenix.util.IndexUtil.getIndexColumnExpressionStr(IndexUtil.java:722)
          at org.apache.phoenix.parse.IndexExpressionParseNodeRewriter.<init>(IndexExpressionParseNodeRewriter.java:59)
          at org.apache.phoenix.optimize.QueryOptimizer.addPlan(QueryOptimizer.java:346)
          at org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlansForSingleFlatQuery(QueryOptimizer.java:241)
          at org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlans(QueryOptimizer.java:138)
          at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:116)
          at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:102)
          at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:358)
          at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:319)
          at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
          at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:319)
          at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:311)
          at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:2060)
          at sqlline.Commands.executeSingleQuery(Commands.java:1054)
          at sqlline.Commands.execute(Commands.java:1003)
      
      

      Lines may not exactly match with open source version since we have few additional changes on top of 4.16 open source branch.

      Attachments

        Activity

          People

            shahrs87 Rushabh Shah
            shahrs87 Rushabh Shah
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: