From 26eeeff5164b5eba8342d5e8db5cd8d3a6a6528e Mon Sep 17 00:00:00 2001 From: MinhLA1410 <36942826+MinhLA1410@users.noreply.github.com> Date: Thu, 25 Nov 2021 09:30:48 +0700 Subject: [PATCH] [Fix] Replace children() with fields(), because children() no longer works in Arrow library greater than v6.0.0 (#8) Co-authored-by: LeAnhMinh --- .gitignore | 2 +- src/common.cpp | 2 +- src/parquet_impl.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index daf368e..88aa0bf 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ *.bc regression.diffs regression.out -results +results \ No newline at end of file diff --git a/src/common.cpp b/src/common.cpp index ce36c4c..9a788a6 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -131,7 +131,7 @@ bytes_to_postgres_type(const char *bytes, arrow::DataType *arrow_type) arrow::Type::type get_arrow_list_elem_type(arrow::DataType *type) { - auto children = type->children(); + auto children = type->fields(); Assert(children.size() == 1); return children[0]->type()->id(); diff --git a/src/parquet_impl.cpp b/src/parquet_impl.cpp index cb540f1..ae7187f 100644 --- a/src/parquet_impl.cpp +++ b/src/parquet_impl.cpp @@ -659,7 +659,7 @@ extract_parquet_fields(const char *path, const char *dirname, Aws::S3::S3Client Oid pg_subtype; bool error = false; - if (type->children().size() != 1) + if (type->fields().size() != 1) throw std::runtime_error("lists of structs are not supported"); subtype_id = get_arrow_list_elem_type(type.get());