Skip to content

Address review comments: replace FQN with imports, parameterize tests#5

Closed
yihua wants to merge 1 commit into
linliu-code:nested_partitioningfrom
yihua:nested-partitioning-review-followup
Closed

Address review comments: replace FQN with imports, parameterize tests#5
yihua wants to merge 1 commit into
linliu-code:nested_partitioningfrom
yihua:nested-partitioning-review-followup

Conversation

@yihua
Copy link
Copy Markdown

@yihua yihua commented May 15, 2026

Describe the issue this Pull Request addresses

Follow-up to review comments on apache#18126, specifically apache#18126 (review) and the test-redundancy discussion. Targets your PR branch so the changes flow into apache#18126.

Summary and Changelog

  • SparkHoodieTableFileIndex: import DataType and LinkedHashMap at the top of the file; drop the inline org.apache.spark.sql.types.DataType / scala.collection.mutable.LinkedHashMap qualifiers in NestedFieldNode and buildNestedPartitionSchema.
  • TestCOWDataSource: import LogicalRelation, HadoopFsRelation, HoodieFileIndex, HoodieBaseRelation; drop the inline FQN usages in runNestedFieldPartitionTest.
  • TestHoodieFileIndex: collapse 6 testBuildNestedPartitionSchema* cases into a single @ParameterizedTest driven by buildNestedPartitionSchemaCases, and 3 testExtractNestedPartitionFilters* cases into extractNestedPartitionFiltersCases. The conflict-throws case stays as a focused @Test since its shape differs.

Net change: -100 / +86 (mostly test consolidation).

Impact

Test-only and import-style refactor. No behavior change.

Risk Level

none

Documentation Update

none

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

- SparkHoodieTableFileIndex: add `DataType` and `LinkedHashMap` imports,
  drop the inline fully-qualified references in `NestedFieldNode` and
  `buildNestedPartitionSchema`.
- TestCOWDataSource: add imports for `LogicalRelation`, `HadoopFsRelation`,
  `HoodieFileIndex`, `HoodieBaseRelation`; drop FQN in
  `runNestedFieldPartitionTest`.
- TestHoodieFileIndex: collapse six `testBuildNestedPartitionSchema*`
  cases into a single `@ParameterizedTest` driven by
  `buildNestedPartitionSchemaCases`; collapse three
  `testExtractNestedPartitionFilters*` cases into
  `extractNestedPartitionFiltersCases`. Keeps the conflict-throws case
  as a focused `@Test`.
@yihua yihua closed this May 15, 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