SEPURI-SAI-KRISHNA commented on issue #12968:
URL: https://github.com/apache/seatunnel/issues/12968#issuecomment-6399683791

   Confirmed, @SEZ9. Both guards are in the generics `convert` overload, which 
is the one `ArrowToSeatunnelRowReader` calls, and both are the same shape as 
the list converters.
   
   `StructConverter.convert(int, StructVector, Map<String, Function>)`:
   
   ```java
   if (fieldVector.isNull(rowIndex)) {
       return null;
   }
   Map<String, ?> valueMap = fieldVector.getObject(rowIndex);
   ```
   
   `MapConverter.convert(int, MapVector, Map<String, Function>)`:
   
   ```java
   if (fieldVector.isNull(rowIndex)) {
       return null;
   }
   UnionMapReader reader = fieldVector.getReader();
   ```
   
   In both cases the guard is the first statement of the method, before the 
dereference that used to fail. That is character for character what 
`ListConverter` and `LargeListConverter` already have at lines 44-46 of each, 
so all the container converters now answer a null cell the same way.
   
   One difference worth stating so the consistency claim is not overstated: the 
list converters follow their null check with an `isEmpty(rowIndex)` check that 
returns an empty list. `MapConverter` has no equivalent, because an empty map 
falls out of the normal path already, the reader simply yields no entries. That 
is what `testEmptyMapCellStaysAnEmptyMap` pins, so empty stays distinct from 
null without a second branch.
   
   The production diff is 6 added lines across the two files, nothing else 
changed.
   


-- 
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]

Reply via email to