Skip to content

Add jobs testing for RTAS - #684

Open
jiang95-dev wants to merge 3 commits into
linkedin:mainfrom
jiang95-dev:lejiang/rtas-jobs-tests
Open

Add jobs testing for RTAS#684
jiang95-dev wants to merge 3 commits into
linkedin:mainfrom
jiang95-dev:lejiang/rtas-jobs-tests

Conversation

@jiang95-dev

@jiang95-dev jiang95-dev commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Added a test suite for running jobs on RTAS'ed tables.

  • Retention case 1: Mismatch between old retention config and the current schema.
    • Jobs failed due to analysis error. The partition column was not found.
  • Retention case 2: Patition spec removed without dropping the column
    • Jobs succeeded but spark delete will be converted from metadata-only delete to overwrite.
  • Retention case 3: RTAS happens before Spark delete.
    • Jobs deleted the new data but it is a valid operation.
  • Retention case 4: RTAS happens during Spark delete with overwrite.
    • Jobs failed because of the snapshot lineage validation.
  • Retention case 5: RTAS happens during Spark delete with metadata-only delete.
    • Jobs deleted the new data but it is a valid operation.
  • SE runs properly for post-RTAS table.
  • OFD runs properly for post-RTAS table.

Also starts to reject RTAS command when the new schema mismatch the retention config.

Changes

  • Client-facing API Changes
  • Internal API Changes
  • Bug Fixes
  • New Features
  • Performance Improvements
  • Code Style
  • Refactoring
  • Documentation
  • Tests

For all the boxes checked, please include additional details of the changes made in this pull request.

Testing Done

  • Manually Tested on local docker setup. Please include commands ran, and their output.
  • Added new tests for the changes made.
  • Updated existing tests to reflect the changes made.
  • No tests added or updated. Please explain why. If unsure, please feel free to ask for help.
  • Some other form of testing like staging or soak time in production. Please explain.

For all the boxes checked, include a detailed description of the testing done for the changes made in this pull request.

Additional Information

  • Breaking Changes
  • Deprecations
  • Large PR broken into smaller PRs, and PR plan linked in the description.

For all the boxes checked, include additional details of the changes made in this pull request.

Table replaced = ops.getTable(tableName);
Assertions.assertNull(
replaced.schema().findField("datepartition"),
"Replace should have dropped the column the in-flight job was launched with");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous table property is considered invalid and we need to validate it when RTAS occurs. RTAS can leave the table in an invalid state. I see the fix as either proactive validation, or that we don't allow RTAS until you disable retention, or we restirc the column modifications that orther features are depending on

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me reject users RTAS request when the retention policy contradicts with the schema.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the validation.

"Current behavior: a delete planned pre-RTAS rebases onto the replacement");

// It lands as a snapshot that deletes nothing. The files it planned to remove belong to the
// pre-RTAS table and are not part of the replacement, so the filter matches nothing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its the opposite condition I am worried about where a newly RTAS'd table immediately purges newly written data. WE might be fine becuase this is implemented as a logical operation but if they drop a partition spec what was a cheap metadata op becomes an expensive query.

can we also test the removal of partitioning where otherwise the data was fine?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be fine since today the retention column is also not required to be a partition column.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a tests on this.

"Replace should have moved the table off the snapshot the delete was planned on");
verifyRowCount(ops, tableName, 2);

// The retention delete commits onto the staled snapshot instead of failing. The writer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this valid?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me verify it again, spark delete does not seem to be a newDelete() operation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out spark delete doesn't go through this route. Added other 3 tests. It will delete new data but it is a valid operation.

@jiang95-dev
jiang95-dev force-pushed the lejiang/rtas-jobs-tests branch 2 times, most recently from 480da07 to 5ee8372 Compare August 28, 2026 01:33
@jiang95-dev
jiang95-dev force-pushed the lejiang/rtas-jobs-tests branch from 5ee8372 to bbb89f5 Compare August 28, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants