wombatu-kun opened a new pull request, #12831:
URL: https://github.com/apache/hudi/pull/12831
### Change Logs
Recently i faced this failure:
`Error:
TestHoodieAvroDataBlock.testGetRecordIteratorWithInputStream:188->verifyRecords:360
Record count mismatch ==> expected: <0> but was: <1000>`
That happened because of unnecessary random value generation in
`selectRandomRecords`: as a number of selected records was randomly generated 0
value, so it returned an empty list `recordsForFilter` (and `keysForFilter`).
Later, when we call `dataBlock.getRecordIterator` with empty list as
`keysForFilter`, it returns all records, and it causes records verification to
fail.
This PR fixes it by not using Random for generating number of selected
records, just use value `allRecordsNum/4`.
### Impact
fix flaky test
### Risk level (write none, low medium or high below)
none
### Documentation Update
none
- _The config description must be updated if new configs are added or the
default value of the configs are changed_
- _Any new feature or user-facing change requires updating the Hudi website.
Please create a Jira ticket, attach the
ticket number here and follow the
[instruction](https://hudi.apache.org/contribute/developer-setup#website) to
make
changes to the website._
### Contributor's checklist
- [ ] Read through [contributor's
guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]