Skip to content

feat(datafusion): support the $audit_log system table - #787

Draft
jerry-024 wants to merge 3 commits into
apache:mainfrom
jerry-024:feat/audit-log-system-table
Draft

feat(datafusion): support the $audit_log system table#787
jerry-024 wants to merge 3 commits into
apache:mainfrom
jerry-024:feat/audit-log-system-table

Conversation

@jerry-024

@jerry-024 jerry-024 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Purpose

Add Paimon Java-compatible support for querying the $audit_log system table from DataFusion and the core read API.

The table exposes each row's physical row kind and, when enabled in the persisted table options, its sequence number. It preserves current-state merge semantics for primary-key tables instead of dropping winning retract rows.

Brief change log

  • Register <table>$audit_log in the DataFusion system-table loader.
  • Expose rowkind as the first column and optional _SEQUENCE_NUMBER after it.
  • Support projection, predicate pushdown with exact residual filtering, limits, runtime filters, time travel, and query authorization.
  • Add current-state audit reads for append-only and primary-key tables.
  • Support deduplicate, first-row, partial-update, and aggregation merge paths, including ignore-delete behavior.
  • Preserve Java-compatible deletion-vector visibility: rows hidden by deletion vectors are not reconstructed as retract records.
  • Reject dynamically enabling table-read.sequence-number.enabled, matching Paimon Java; persisted table configuration remains supported.
  • Bound merge fan-in and share the Parquet read budget across audit input paths.

Tests

  • cargo +1.94.0 test -p paimon --test audit_log_table_test — 19 passed
  • cargo +1.94.0 test -p paimon-datafusion --test system_tables — 20 passed
  • cargo +1.94.0 clippy -p paimon-datafusion --lib --test system_tables -- -D warnings
  • cargo fmt --all
  • git diff --check

Coverage includes append-only and primary-key row kinds, sequence numbers, merge engines, ignore-delete, projection/filter/limit behavior, dynamic time travel and authorization, deletion vectors, and Java-compatible dynamic-option validation.

API and Format

Adds the $audit_log system-table API and core audit-read support. No existing API is removed or changed incompatibly.

No storage-format change is introduced; existing Paimon data files, manifests, deletion vectors, and table options remain compatible.

Documentation

Updated docs/src/sql.md with $audit_log schema, query examples, row-kind semantics, sequence-number behavior, and deletion-vector visibility.

@jerry-024
jerry-024 marked this pull request as draft September 3, 2026 07:25
@jerry-024 jerry-024 changed the title feat: support audit log system table feat(datafusion): support the $audit_log system table Sep 3, 2026
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.

1 participant