clintropolis opened a new pull request, #12914: URL: https://github.com/apache/druid/pull/12914
### Description This PR adjusts array handling in the direction of standardizing the representations on `Object[]` as well as `long[]`, `double[]`, and `float[]`. This is follow-up to https://github.com/apache/druid/pull/12498#discussion_r941829087 and a follow-up discussion I had with @gianm. The main changes are removing the remaining leaks of typed object arrays such as `Long[]`, `Double[]`, and `Float[]` from the expression system, as well as adding support for handling arrays of java primitives such as `long[]`, `float[]`, and `double[]`. Expressions do not produce these primitive arrays, but aggregators and post-aggs can. I've added javadocs to try to help provide additional details on native type matters. I've adjusted the behavior of the expression column value selector when the virtual column output type is `STRING` to behave a bit more like a normal multi-value string column, and return the value directly when there is only a single value contained in the list. This does slightly change scan query results, which for multi-value string expressions would always produce array typed results, but now will produce a mix of array and scalar values. I think this behavior is more consistent with how the multi-value string columns themselves behave, but I can put it behind a flag if anyone is worried about this change. I encountered a bug with `array_slice` output type inference, which was not indicating its output as array output, instead reporting the output type of its argument. This issue became clear due to the stronger separation between multi-value string handling and array handling that now occurs in the expression selectors. <hr> This PR has: - [ ] been self-reviewed. - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links. - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader. - [ ] 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]
