clintropolis opened a new pull request, #17906: URL: https://github.com/apache/druid/pull/17906
### Description Projections were not correctly handling the case of persisting segments if `merger.hasOnlyNulls()` was true, where it was skipping writing a column at all which would lead to having a null buffer when trying to map the smoosh file for a column that the projection thought should exist due to its schema. To fix, projections will now use `NullColumnPartSerde` for the case of `hasOnlyNulls()` true, regardless of how `storeEmptyColumns` is set. This is correct because: - if `storeEmptyColumns` is true, the base table also does this, - if `storeEmptyColumns is false, the base table omits the column from the dimensions list as if it does not exist, however for projections the dimensions list is always populated by the projection schema, so acolumn always needs to exist to not run into null pointer exceptions. Added test to ensure all null string columns work correctly no matter how `storeEmptyColumns` is set. <hr> This PR has: - [x] been self-reviewed. - [x] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader. - [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met. - [ ] been tested in a test Druid cluster. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
