Skip to content

[hive] Unescape partition path values when building Hive split predicate - #9080

Merged
JingsongLi merged 1 commit into
apache:masterfrom
thswlsqls:fix/hive-split-partition-path-unescape
Aug 6, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
thswlsqls:fix/hive-split-partition-path-unescape

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #9077

  • HiveSplitGenerator.createPartitionPredicate() parsed the Hive input dir with split("/") and split("=") and never unescaped the values.
  • Partition directories are escaped when registered, so a value such as 2026-01-01 00:00 reaches the predicate as 2026-01-01 00%3A00, matches nothing, and the Hive query silently returns zero rows.
  • Use PartitionPathUtils.extractPartitionSpecFromPath(), which unescapes; this was the last production site parsing a partition path by hand.
  • Values needing no escaping are unaffected; the tag branch and Optional.empty() fallback are untouched.

Tests

  • Added HiveSplitGeneratorTest#testGenerateSplitsForEscapedPartitionValue (escaped value now matches) and #testGenerateSplitsForPlainPartitionValue (regression).
  • Reverting the fix fails only the escaped-value test; generateSplits had no prior coverage, so this adds cases rather than changing existing ones.
  • mvn -pl paimon-hive/paimon-hive-connector-common clean install — 102 unit tests and 83 *ITCase tests passed.

Partition directories are escaped by PartitionPathUtils#escapePathName, so
the split predicate built from the Hive input dir must unescape them.

Generated-by: Claude Code
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit ac87927 into apache:master Aug 6, 2026
11 of 12 checks passed
@thswlsqls
thswlsqls deleted the fix/hive-split-partition-path-unescape branch August 14, 2026 22:51
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] Hive returns zero rows for partition values containing escaped characters

2 participants