Skip to content

[core] Do not hide the escaped default partition directory in the value-only layout - #11173

Merged
JingsongLi merged 1 commit into
apache:masterfrom
plusplusjiajia:fix/core-escaped-default-partition-not-hidden
Nov 29, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
plusplusjiajia:fix/core-escaped-default-partition-not-hidden

Conversation

@plusplusjiajia

@plusplusjiajia plusplusjiajia commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Purpose

With format-table.partition-path-only-value=true, a partition directory whose name starts with _ or . is hidden from scans, except for the default partition. PartitionPathUtils.isHiddenFile recognized the default partition by comparing the raw partition.default-name with the directory name. The writer escapes every value, the default name included, so a default name that escaping changes names a different directory: __NULL/VALUE__ is written to __NULL%2FVALUE__, which the scan then skipped as hidden, and the rows of the null partition were not read. The cleanup of an INSERT OVERWRITE or TRUNCATE of a partition prefix made the same comparison in FormatTableScan.listDataFiles, so it kept that directory's files and the old rows stayed visible.

Both now compare the directory name with the escaped default name, from PartitionPathUtils.defaultPartitionDirName. Other directories that start with _ or . are still hidden. An empty default name names no directory, so no directory is exempted for it, as before.

Found while reviewing #11018, where PyPaimon reads such directories.

Tests

  • PartitionPathUtilsTest#testValueOnlyEscapedDefaultPartitionIsListed: with the default name __NULL/VALUE__, the escaped default partition directory and a normal value are listed, and a _hidden directory is skipped.
  • PartitionPathUtilsTest#testValueOnlyEmptyDefaultPartitionNameNamesNoDirectory: with an empty default name, the other partitions are listed and _hidden is skipped.
  • FormatTableCommitTest#testOverwritingAPrefixClearsTheDefaultPartitionDirectory now also runs with __NULL/VALUE__: overwriting a prefix clears 2025/__NULL%2FVALUE__.
  • PartitionPathUtilsTest (27) and FormatTableCommitTest (74) pass; the new cases fail without the change.

🤖 Generated with Claude Code

@plusplusjiajia
plusplusjiajia force-pushed the fix/core-escaped-default-partition-not-hidden branch 2 times, most recently from 0ecc2d5 to 1ee20f4 Compare November 16, 2026 01:39
@plusplusjiajia
plusplusjiajia marked this pull request as ready for review November 23, 2026 10:22
…ue-only layout

With format-table.partition-path-only-value=true, scans hide directories
whose names start with '_' or '.', except for the default partition.
isHiddenFile recognized it by comparing the raw partition.default-name
with the directory name, but the writer escapes the default name like
every value, so a default name that escaping changes, such as
__NULL/VALUE__ written to __NULL%2FVALUE__, was skipped as hidden and
the rows of the null partition were not read. The cleanup of an
INSERT OVERWRITE or TRUNCATE of a partition prefix made the same
comparison in FormatTableScan.listDataFiles and kept that directory's
files.

Both now compare the directory name with the escaped default name,
from PartitionPathUtils.defaultPartitionDirName. An empty default name
names no directory, so no directory is exempted for it, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@plusplusjiajia
plusplusjiajia force-pushed the fix/core-escaped-default-partition-not-hidden branch from 1ee20f4 to f39db07 Compare November 27, 2026 11:00
@JingsongLi
JingsongLi merged commit 8b641ae into apache:master Nov 29, 2026
20 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