test: add unit test for multiple partition filters on same column#17934
test: add unit test for multiple partition filters on same column#17934nsivabalan merged 7 commits intoapache:masterfrom
Conversation
voonhous
left a comment
There was a problem hiding this comment.
Possible to add an FT for this? Thank you
nsivabalan
left a comment
There was a problem hiding this comment.
thanks for the fix.
we need to add tests please.
012b5aa to
143c132
Compare
|
@voonhous @nsivabalan |
|
If the build passes, then I will reword the PR to include only the unit test. |
No idea, i was trying to reproduce this too and couldn't. Which is why i asked for a unit test to be added so i could repro it... Hmmm, nonetheless, we can change this PR to a test PR to add test coverage. |
|
@voonhous @nsivabalan I reworded the description, can you please review this again? |
|
|
||
| @ParameterizedTest | ||
| @CsvSource(value = Array("cow", "mor")) | ||
| def testMultiplePartitionFiltersPushDown(tableType: String): Unit = { |
There was a problem hiding this comment.
oh, can you parametrize to run this for both version 6 and 9.
There was a problem hiding this comment.
Yes, made the change.
f4f860f to
20c2df1
Compare
…partition filters When there are multiple filters on the same column (e.g., datestr > '2016-01-01' AND datestr < '2016-12-31'), using ExpressionSet to append filters and then converting back to Seq[Expression] causes some filters to be dropped. This fix removes the ExpressionSet conversion logic to preserve all partition filters.
20c2df1 to
41e4e96
Compare
Describe the issue this Pull Request addresses
Initially, we observed partition filters being dropped in our production systems when multiple conditions were applied to the same partition column (e.g.,
datestr > '2016-01-01' AND datestr < '2016-12-31'). However, when creating a unit test to reproduce the issue, the filters were correctly preserved without any code changes. Since we could not reliably reproduce the issue in the test environment, this PR adds test coverage to prevent potential regressions.Summary and Changelog
Adds
testMultiplePartitionFiltersPushDowntest inTestHoodiePruneFileSourcePartitionsto validate that multiple partition filters (IsNotNull, GreaterThan, LessThan) on the same column are preserved during query optimization. Test covers both COW and MOR table types with range queries.Impact
Adds test coverage to ensure partition filter correctness, helping prevent potential filter loss issues in the future. No user-facing changes.
Risk Level
none - Test-only change, no production code modifications.
Documentation Update
none
Contributor's checklist