pvary commented on PR #18508:
URL: https://github.com/apache/iceberg/pull/18508#issuecomment-6293671732
The more I see the copying, the more I hate it.
What if we create a wrapper above Arrays and Maps, like:
```
private static class ArrayDataList extends AbstractList<Object> implements
RandomAccess {
private final ArrayData array;
private final ArrayData.ElementGetter getter;
private final Function<Object, Object> converter;
@Override
public Object get(int index) {
Preconditions.checkElementIndex(index, array.size());
return convertElement(array, index, getter, converter);
}
}
private static class MapDataMap extends AbstractMap<Object, Object> {
private final MapData map;
private final ArrayData.ElementGetter keyGetter;
private final Function<Object, Object> keyConverter;
private final ArrayData.ElementGetter valueGetter;
private final Function<Object, Object> valueConverter;
...
```
--
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]