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

DESC primary key column with variable length does not work in SkipScanFilter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.11.0
    • 4.14.0, 5.0.0
    • None
    • None

    Description

      Example:

          @Test
          public void inDescCompositePK3() throws Exception {
              String table = generateUniqueName();
              String ddl = "CREATE table " + table + " (oid VARCHAR NOT NULL, code VARCHAR NOT NULL constraint pk primary key (oid DESC, code DESC))";
              Object[][] insertedRows = new Object[][]{{"o1", "1"}, {"o2", "2"}, {"o3", "3"}};
              runQueryTest(ddl, upsert("oid", "code"), insertedRows, new Object[][]{{"o2", "2"}, {"o1", "1"}}, new WhereCondition("(oid, code)", "IN", "(('o2', '2'), ('o1', '1'))"),
                  table);
          }
      

      Here the last column in primary key is in DESC order and has variable length, and WHERE clause involves an "IN" operator with RowValueConstructor specifying all PK columns. We get no results.

      This ends up being the root cause for not being able to use child/parent join optimization on DESC pk columns as described in PHOENIX-3050.

      Attachments

        1. PHOENIX-4322.patch
          3 kB
          Wei Xue

        Issue Links

          Activity

            People

              maryannxue Wei Xue
              maryannxue Wei Xue
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: