You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "clintropolis (via GitHub)" <gi...@apache.org> on 2023/03/23 20:37:09 UTC

[GitHub] [druid] clintropolis commented on pull request #13803: nested columns + arrays = array columns!

clintropolis commented on PR #13803:
URL: https://github.com/apache/druid/pull/13803#issuecomment-1481862585

   I've fixed the behavior of `UNNEST` with regards to how it handles `null` and `[]` values for `ARRAY` typed inputs. Per experiments with postgres, `null` and empty arrays `[]` are supposed to output nothing when fed into `UNNEST`:
   
   <img width="1259" alt="Screenshot 2023-03-23 at 2 02 11 AM" src="https://user-images.githubusercontent.com/1577461/227349056-a3d6794c-dcba-4222-86ea-ecd9ceec65f5.png">
   
   <img width="1015" alt="Screenshot 2023-03-23 at 2 04 02 AM" src="https://user-images.githubusercontent.com/1577461/227349099-04e9c280-7ff4-4388-9e37-0708dad62cf4.png">
   
   <img width="1270" alt="Screenshot 2023-03-23 at 2 04 57 AM" src="https://user-images.githubusercontent.com/1577461/227349136-a7b5a2d5-ce81-4ef4-bfb2-42d6bb552687.png">
   
    but currently we are treating them as `[null]`, which is probably unfortunately what we have to keep doing for multi-value `STRING` types because we have trouble distinguishing `null`, `[]` and `[null]`, but no need to do this with actual arrays. So, I have fixed `UnnestColumnValueSelectorCursor` to consume `null` and `[]` values, fixing the behavior and added some tests.
   
   


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org