Skip to content

chore(provision): make Spark integration test provisioning idempotent#198

Merged
JingsongLi merged 1 commit intoapache:mainfrom
freedom3219:fix/spark-provision-idempotency
Apr 5, 2026
Merged

chore(provision): make Spark integration test provisioning idempotent#198
JingsongLi merged 1 commit intoapache:mainfrom
freedom3219:fix/spark-provision-idempotency

Conversation

@freedom3219
Copy link
Copy Markdown
Contributor

Purpose

Make Spark-based integration test fixture provisioning idempotent.

dev/spark/provision.py previously used CREATE TABLE IF NOT EXISTS together with unconditional INSERT INTO statements. Re-running provisioning against the same warehouse caused append/log tables to accumulate duplicate rows, which made the test fixture non-deterministic and broke integration tests.

Brief change log

  • Resolve the configured Paimon warehouse path from Spark config
  • Clear the existing warehouse contents before provisioning test fixtures
  • Keep the existing table definitions and fixture data unchanged
  • Preserve the current reader behavior and test expectations while making repeated provisioning deterministic

This approach fits the current repository architecture because the integration tests assert exact fixture contents, while append tables are read as appended data rather than deduplicated business rows. Resetting the whole warehouse before provisioning is the most reliable way to keep the fixture stable across append tables, DV PK tables, and data evolution tables.

Tests

Verified idempotent provisioning by running fixture setup twice against the same warehouse, then running:

  • cargo test -p paimon-integration-tests --test read_tables
  • cargo test -p paimon-datafusion --test read_tables

API and Format

Documentation

Copy link
Copy Markdown
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit abb0a43 into apache:main Apr 5, 2026
8 checks passed
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