Skip to content

[KYUUBI #6803][AUTHZ] Add Paimon authz plan-level, row-filter and data-mask tests - #7596

Draft
bowenliang123 wants to merge 3 commits into
apache:masterfrom
bowenliang123:improve-paimon-authz
Draft

[KYUUBI #6803][AUTHZ] Add Paimon authz plan-level, row-filter and data-mask tests#7596
bowenliang123 wants to merge 3 commits into
apache:masterfrom
bowenliang123:improve-paimon-authz

Conversation

@bowenliang123

@bowenliang123 bowenliang123 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Why are the changes needed?

PaimonCatalogRangerSparkExtensionSuite is the only Paimon test layer in Spark authz; the three Iceberg-specific layers (*PrivilegesBuilderSuite, RowFilteringFor*, DataMaskingFor*) are absent. A regression in table_command_spec.json or the Paimon extractor therefore surfaces only as a wrong error message in the e2e suite, not as a precise plan-level diff, and Paimon users running with row-filter and data-masking policies get no coverage at all.

What this PR does

  • New PaimonCatalogPrivilegesBuilderSuite: four Paimon-specific plan tests (DeleteFromPaimonTable, UpdatePaimonTable, MergeIntoPaimonTable, PaimonCallProcedure) plus the 30 inherited V2 plan tests. Paimon TRUNCATE and dynamic partition overwrite skip via two new opt-out flags on the shared base.
  • New RowFilteringForPaimonSuite and DataMaskingForPaimonSuite mirroring the Iceberg counterparts.
  • Existing e2e suite: rename the Producers test to Procedures (typo) and propagate comment = "Paimon" to all four tableDescs for consistency with Iceberg / Hudi / Delta; regenerate the spec JSON.
  • V2CommandsPrivilegesSuite: add supportsTruncateTable and supportsOverwritePartitionsDynamic (default true) following the existing supportsX flag pattern.

No production code is changed.

How was this patch tested?

Default Spark 3.5 / Paimon 0.8.2 / Scala 2.12 build, one Paimon suite per command plus regression runs against the two existing plan suites that share V2CommandsPrivilegesSuite:

mvn -pl extensions/spark/kyuubi-spark-authz \
    -Pspark-3.5,hive-provided,spark-provided,flink-provided \
    -Dtest=none -DwildcardSuites=... test
Suite passed canceled
PaimonCatalogRangerSparkExtensionSuite 37 0
PaimonCatalogPrivilegesBuilderSuite 78 14
RowFilteringForPaimonSuite 7 1
DataMaskingForPaimonSuite 15 3
IcebergCatalogPrivilegesBuilderSuite (regression) 80 12
V2JdbcTableCatalogPrivilegesBuilderSuite (regression) 83 10
JsonSpecFileGenerator 1 0

Cancelations are intentional: Procedures is gated on Spark 3.4+, Paimon has no permanent-view support, SetNamespaceLocation is hive-catalog-only.

RowFilteringForPaimonSuite and DataMaskingForPaimonSuite are also gated on isScalaV212 || isSparkV40OrGreater (same rule as PaimonCatalogRangerSparkExtensionSuite). On Scala 2.13 + Spark < 4.0, Paimon 0.8.2 ships generated paimon-codegen/scala/Serializable.class that references the Scala 2.12 scala.Serializable trait, removed in Scala 2.13 — touching SparkCatalog triggers NoClassDefFoundError: scala/Serializable. On Spark 4.0+ Paimon also requires PaimonSparkSessionExtensions to be registered. The two suites therefore skip test registration and beforeAll/afterAll on unsupported configurations, matching the existing Paimon pattern.

Spotless across all six Spark profiles:

mvn spotless:apply \
    -Pflink-provided,hive-provided,spark-provided,spark-4.2,spark-4.1,spark-4.0,spark-3.5,spark-3.4,spark-3.3,tpcds,kubernetes-it

Was this patch authored or co-authored using generative AI tooling?

Yes.

Assisted-by: MiniMax-M3

@bowenliang123
bowenliang123 marked this pull request as draft July 29, 2026 14:08
@bowenliang123 bowenliang123 changed the title [KYUUBI #6803][KYUUBI #5430][AUTHZ] Bring Paimon authz test coverage to Iceberg parity [KYUUBI #6803][AUTHZ] Add Paimon authz plan-level, row-filter and data-mask tests Jul 29, 2026
…st coverage to Iceberg parity

Test-only changes; no production code touched.

* New PaimonCatalogPrivilegesBuilderSuite mirrors IcebergCatalogPrivilegesBuilderSuite:
  DeleteFromPaimonTable, UpdatePaimonTable, MergeIntoPaimonTable (with PK target),
  PaimonCallProcedure, plus 30 inherited V2 plan tests (Paimon-specific TRUNCATE
  and dynamic partition overwrite skipped via the new supportsTruncateTable /
  supportsOverwritePartitionsDynamic flags).
* New RowFilteringForPaimonSuite and DataMaskingForPaimonSuite mirror the
  Iceberg counterparts; gated by @PaimonTest.
* PaimonCatalogRangerSparkExtensionSuite: rename the typo'd 'Producers' test to
  'Procedures' so it matches the Iceberg CALL pattern.
* PaimonCommands spec builder: propagate 'comment = Paimon' to all four
  tableDescs and regenerate the table_command_spec.json golden file.
* V2CommandsPrivilegesSuite base: add supportsTruncateTable and
  supportsOverwritePartitionsDynamic (default true) following the existing
  supportsX flag pattern; consumed by the Paimon subclass only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant