Tuples as keys in dicts can be serialized

This commit is contained in:
William Paul
2016-08-24 23:31:09 +00:00
parent 7b548bddd3
commit f468871b5d
4 changed files with 13 additions and 6 deletions
+2 -1
View File
@@ -5,12 +5,13 @@ using namespace arrow;
namespace numbuf {
std::shared_ptr<arrow::StructArray> DictBuilder::Finish(
std::shared_ptr<Array> key_tuple_data,
std::shared_ptr<Array> list_data,
std::shared_ptr<Array> tuple_data,
std::shared_ptr<Array> dict_data) {
// lists and dicts can't be keys of dicts in Python, that is why for
// the keys we do not need to collect sublists
auto keys = keys_.Finish(nullptr, nullptr, nullptr);
auto keys = keys_.Finish(nullptr, key_tuple_data, nullptr);
auto vals = vals_.Finish(list_data, tuple_data, dict_data);
auto keys_field = std::make_shared<Field>("keys", keys->type());
auto vals_field = std::make_shared<Field>("vals", vals->type());
+1
View File
@@ -34,6 +34,7 @@ public:
value list of the dictionary
*/
std::shared_ptr<arrow::StructArray> Finish(
std::shared_ptr<arrow::Array> key_tuple_data,
std::shared_ptr<arrow::Array> list_data,
std::shared_ptr<arrow::Array> tuple_data,
std::shared_ptr<arrow::Array> dict_data);