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

WhereOptimizer.pushKeyExpressionsToScan() does not work correctly if the sort order of pk columns being filtered on changes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 4.14.0, 5.0.0
    • 5.2.1
    • None
    • None

    Description

      ExpressionComparabilityWrapper should set the sort order based on childPart.getColumn() or else the attached test throws an IllegalArgumentException

      
      java.lang.IllegalArgumentException: 4 > 3
      at java.util.Arrays.copyOfRange(Arrays.java:3519)
      at org.apache.hadoop.hbase.io.ImmutableBytesWritable.copyBytes(ImmutableBytesWritable.java:272)
      at org.apache.phoenix.compile.WhereOptimizer.getTrailingRange(WhereOptimizer.java:329)
      at org.apache.phoenix.compile.WhereOptimizer.clipRight(WhereOptimizer.java:350)
      at org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:237)
      at org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:157)
      at org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:108)
      at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:556)
      

      Also in pushKeyExpressionsToScan() we cannot extract pk column nodes from the where clause if the sort order of the columns changes.

      Attachments

        1. PHOENIX-4846-wip.patch
          11 kB
          Thomas D'Silva

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: