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

Delete Immutable rows from View does not work if immutable index(secondary index) exists

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 4.7.0
    • Fix Version/s: 4.8.1
    • Labels:

      Description

      REPRO:

      --create a immutable table
      CREATE TABLE IF NOT EXISTS TEST_TABLE (
      FIELD1 CHAR(3) NOT NULL,
      FIELD2 CHAR(3) NOT NULL,
      CONSTRAINT PK PRIMARY KEY (
      FIELD1,
      FIELD2
      )
      ) VERSIONS=1, IMMUTABLE_ROWS=true, MULTI_TENANT=true, REPLICATION_SCOPE=1

      --create a new view on the immutable table
      CREATE VIEW IF NOT EXISTS TEST_VIEW (
      FIELD3 INTEGER NOT NULL,
      FIELD4 VARCHAR NOT NULL,
      CONSTRAINT PKVIEW PRIMARY KEY
      (
      FIELD3 DESC
      )
      )
      AS SELECT * FROM TEST_TABLE WHERE FIELD2 = '001'

      – create secondary index on the
      CREATE INDEX IF NOT EXISTS TEST_SECONDARY_INDEX
      ON TEST_VIEW (FIELD4 DESC)
      INCLUDE (FIELD3)
      REPLICATION_SCOPE=1

      --Delete rows for TEST_VIEW
      delete from TEST_VIEW where FIELD1 = '000';

      [Expect] The rows can be removed
      [Actual] Under DeleteCompiler.Compile(), the secondary index will be considered as immutable index. And as line 408, table.getType will be VIEW instead of PTableType.INDEX, we will get error in line 425 with the exception.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              JipingZhou Jiping Zhou
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: