Commits


Benjamin Kietzman authored and Antoine Pitrou committed dede1e69514
ARROW-1207: [C++] Implement MapArray, MapBuilder, MapType classes, and IPC support Implements `MapArray` as a subclass of `ListArray`, where each `value` in the list is a `key: item` pair. (This naming is not the most natural, but `value` is taken.) `MapType::keys_sorted()` is currently stored but unused- for example `MapBuilder` does not check inserted keys for correct ordering. `MapType` is printed as `map<utf8, int32>` and `map<int32, float64, keys_sorted>` for unsorted, sorted keys respectively. Map arrays are created with `ArrayFromJSON` by providing for each pair an array of length 2 containing the key and the mapped item [(example)](https://github.com/apache/arrow/compare/master...bkietz:1207-Implement-Map-logical-type?expand=1#diff-015ed4b6849ed6e64e25bba42aa1d29eR572). Author: Benjamin Kietzman <bengilgit@gmail.com> Closes #4352 from bkietz/1207-Implement-Map-logical-type and squashes the following commits: 9fb8700d7 <Benjamin Kietzman> explicitly disable map in flight test 41b30161b <Benjamin Kietzman> more cleanup, disable JS ipc tests as well 1b74aa128 <Benjamin Kietzman> disable map IPC tests for Java a0de5513f <Benjamin Kietzman> cleanup of code which assumes map has 2 children 2aaab2914 <Benjamin Kietzman> ListType isa MapType 9b455e76d <Benjamin Kietzman> Add IPC tests for Map 62dade046 <Benjamin Kietzman> remove redundant null check a3be934e4 <Benjamin Kietzman> add tests using and validating MapBuilder c936ebd87 <Benjamin Kietzman> fix MapScalar typos 1047a6d2e <Benjamin Kietzman> run clang-format 31930ffe9 <Benjamin Kietzman> de-inline MapBuilder constructor eb6db030c <Benjamin Kietzman> set keys_, items_ a5c88a116 <Benjamin Kietzman> fix: obj_ is not a pointer 8049c515f <Benjamin Kietzman> MapArray isa ListArray 4c11db99d <Benjamin Kietzman> adding some tests and filling out Map* f89da946b <Benjamin Kietzman> first pass at MapArray, MapBuilder, MapScalar 7fbbe707d <Benjamin Kietzman> add checked_pointer_cast for unique_ptr 5e727e575 <Benjamin Kietzman> add map() type factory e9b34d023 <Benjamin Kietzman> Add keysSorted field 01214fb75 <Benjamin Kietzman> add MapType and test its ToString 47d95efe1 <Benjamin Kietzman> add MapType to Layout.rst