You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/13 09:36:05 UTC

[GitHub] [arrow-rs] tustvold opened a new issue, #1697: MapArray Additional Nullability

tustvold opened a new issue, #1697:
URL: https://github.com/apache/arrow-rs/issues/1697

   **Which part is this question about**
   
   A MapArray is represented in parquet as follows, see [here](https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#maps).
   
   ```
   <map-repetition> group <name> (MAP) {
     repeated group key_value {
       required <key-type> key;
       <value-repetition> <value-type> value;
     }
   }
   ```
   
   However, it is represented in arrow as
   
   ```
   Field::new(
       <name>,
       DataType::Map(
           Box::new(Field::new("entries", DataType::Struct(..), <nullable>))
           <is_sorted>
       )
      <nullable>
   )
   ```
   
   The confusion lies in the fact we now have nullability at three levels:
   
   * Within the MapArray
   * Within the StructArray
   * Within the key and value arrays
   
   When the original parquet data only has nullability at two levels.
   
   The writer logic appears to ignore the nullability of the inner StructArray, which doesn't feel right.
   
   **Describe your question**
   
   * Should the inner StructArray always be not nullable?
   * Could we store `DataType` instead of `Field` in `DataType::Map`
   * Could we store the child `DataType` directly in `DataType::Map`
   
   **Additional context**
   
   https://github.com/apache/arrow-rs/issues/1642 also relates to the semantics of MapArrays
   
   Map Arrays were added by @nevi-me as part of https://github.com/apache/arrow-rs/issues/395
   


-- 
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: github-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow-rs] wjones127 commented on issue #1697: MapArray Additional Nullability

Posted by "wjones127 (via GitHub)" <gi...@apache.org>.
wjones127 commented on issue #1697:
URL: https://github.com/apache/arrow-rs/issues/1697#issuecomment-1712132480

   FYI, the [arrow spec says](https://github.com/apache/arrow/blob/c4b01c60fba85bbfc3a1b1510e179153c0f79515/format/Schema.fbs#L124):
   
   > Neither the "entries" field nor the "key" field may be nullable. 
   
   So it's safe to ignore the nullability at the struct level and for the key field.


-- 
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: github-unsubscribe@arrow.apache.org

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