clintropolis opened a new pull request, #16138:
URL: https://github.com/apache/druid/pull/16138

   ### Description
   `RowSignatures.toRelDataType` did not correctly handle conversion of nested 
array types such as `ARRAY<ARRAY<LONG>>` etc, since the `ARRAY` handling case 
only checked for the primitive column types. I have modified this code to split 
out the `ColumnType` to `RelDataType` conversion into a new method, 
`RowSignatures. columnTypeToRelDataType`, and handle arrays by recursively 
calling this method to convert the element type to a `RelDataType` so that it 
can handle any type of Druid array.
   
   I kind of think this method maybe should be moved into `Calcites` since a 
bunch of the other conversion methods that don't involve `RowSignature` live 
there, but I haven't moved it yet...
   
   Only the second added test would fail, despite just being a count(*) wrapper 
around the first one, and apparently this query used to work ok so I'm not 
entirely sure which change triggered us running into this error, but, this 
could happen with any nested array type so I'm glad we found the issue.
   
   <hr>
   
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [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]

Reply via email to