avshenuk opened a new pull request, #16387:
URL: https://github.com/apache/pinot/pull/16387
### Why:
Collections and arrays containing only non-Map values are already being
unnested into multiple result rows. But the result leaf values are lost after
unnesting.
Example:
```
{
"array": ["x", "y"]
}
```
will be unnested into
```
[
{
"array": ["x", "y"]
},
{
"array": ["x", "y"]
}
]
```
Which is not very helpful as it loses the original association of the actual
unnested value with the corresponding record.
### What:
Current implementation replaces the unnested field values with the original
ones.
Which is unnecessary since the original field value is already preserved in
the copy of the record regardless (as demonstrated by the tests).
The only reason this replacement would be needed is to explicitly disallow
the logic described here: to avoid losing that original array.
But that doesn't sound very convincing, as the unnested version in this
particular scenario is much more useful, in my opinion.
### Use cases:
One that comes to mind is:
- Create multiple copies of a row based on a field like "client ID": you get
2 rows with everything the same except the client ID.
### Summary:
All in all, the feature seems to be supported already but is just being
negated by that replacement logic. If there is any particular reason I've
missed, please let me know.
--
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]