clintropolis opened a new pull request #12025: URL: https://github.com/apache/druid/pull/12025
### Description This PR fixes two issues with multi-value string handling in SQL, both involving constant expressions on string columns which produce array types. The first issue is at the SQL layer, where an array producing expression such as `STRING_TO_MV` in an SQL that could be reduced to a constant would cause a casting exception because the `ARRAY<STRING>` typed output of the constant can not be cast to a string for the `VARCHAR` literal it is trying to create. Fixing this issue uncovered a second problem, this one down in the native engine, where dim selectors on constant expressions would end up using `ConstantDimensionSelector` which converts the expression result into a single string value, which is incorrect for an array typed expression. To handle this, a new `ConstantMultiValueDimensionSelector` has been added that accepts a `List<String>` as input and makes a constant selector on that, allowing array expression constants to work with dimension selectors. <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. - [x] 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]
