Skip to content

[spark] Describe a partition by its values on every Spark version - #11419

Open
LuciferYang wants to merge 2 commits into
apache:masterfrom
LuciferYang:spark42-describe-partition
Open

LuciferYang wants to merge 2 commits into
apache:masterfrom
LuciferYang:spark42-describe-partition

Conversation

@LuciferYang

@LuciferYang LuciferYang commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Closes #11383.

Spark 4.2 (SPARK-39660) plans DESCRIBE ... PARTITION as DescribeTablePartition, which PaimonStrategy does not match, so on 4.2 and 4.3 Spark's own exec prints the raw loadPartitionMetadata map. Before 4.2, PaimonDescribeTableExec matches spec strings against the catalog's partition names, so blank, NULL, DATE, TIMESTAMP and m = '09' partitions report "Found 0 matching partitions".

This PR resolves the spec by value on every version, and a 4.2-module strategy sends DescribeTablePartition to PaimonDescribeTableExec. Statistics come from the table's own scan of the partition columns, for SHOW TABLE EXTENDED ... PARTITION too.

Behavior changes before 4.2:

  • Plain DESCRIBE fails on a missing partition too.
  • The NULL partition is = NULL, not = '__DEFAULT_PARTITION__'.
  • Statistics reported by a REST server or of a system table are no longer shown.

On every version, fallback branch, time travel, scan.bucket and query auth apply as in a read.

Tests

  • DescribeTableTestBase: lookup by value (blank vs NULL, an upper-case column name, the default partition name, a missing partition), INT/DATE/TIMESTAMP/BINARY values, a DV table whose files are all at level 0, a partition only the fallback branch holds (DESCRIBE and SHOW), session time travel, and t$audit_log.
  • UnreportedPartitionStatisticsTest: the fixture injects unknown statistics through loadPartitionMetadata instead of the catalog listing.
  • SparkPartitionMetadataAuthTest: a user granted only the partition columns can describe a partition.
  • paimon-spark-4.2 now runs DescribeTableTest and UnreportedPartitionStatisticsTest, so the spark42 and spark43 lanes cover them.

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.

[Bug] DESCRIBE TABLE ... PARTITION on Spark 4.2 and 4.3 skips Paimon's partition description

1 participant