Repository: parquet-cpp Updated Branches: refs/heads/master 7719d65b7 -> ea0f6e911
PARQUET-1072: Build with ARROW_NO_DEPRECATED_API in Travis CI Also fixes a number of Clang warnings and uses of deprecated API calls as of Arrow 0.6.0 Author: Wes McKinney <[email protected]> Closes #379 from wesm/PARQUET-1072 and squashes the following commits: 1ecd4cd [Wes McKinney] Also set ARROW_NO_DEPRECATED_API for static build 4a09e61 [Wes McKinney] Upgrade Snappy in MSVC toolchain build to 1.1.6 7dd8242 [Wes McKinney] Add entry to Travis CI to build with deprecated APIs, too c70e1bd [Wes McKinney] Skip coverage until fixed later 188100a [Wes McKinney] Build with ARROW_NO_DEPRECATED_API in Travis CI Project: http://git-wip-us.apache.org/repos/asf/parquet-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/parquet-cpp/commit/ea0f6e91 Tree: http://git-wip-us.apache.org/repos/asf/parquet-cpp/tree/ea0f6e91 Diff: http://git-wip-us.apache.org/repos/asf/parquet-cpp/diff/ea0f6e91 Branch: refs/heads/master Commit: ea0f6e911bc711b0ee51f2ab1a772c689a5719b6 Parents: 7719d65 Author: Wes McKinney <[email protected]> Authored: Sun Aug 6 15:43:39 2017 -0400 Committer: Wes McKinney <[email protected]> Committed: Sun Aug 6 15:43:39 2017 -0400 ---------------------------------------------------------------------- .travis.yml | 34 +++++++++++----- benchmarks/decode_benchmark.cc | 15 +++---- ci/before_script_travis.sh | 4 +- ci/msvc-build.bat | 2 +- ci/travis_script_cpp.sh | 6 +-- cmake_modules/ThirdpartyToolchain.cmake | 2 +- .../arrow/arrow-reader-writer-benchmark.cc | 24 +++++++---- src/parquet/arrow/arrow-reader-writer-test.cc | 6 +-- src/parquet/arrow/reader.cc | 6 +-- src/parquet/arrow/test-util.h | 43 +++++++++----------- src/parquet/arrow/writer.cc | 2 +- 11 files changed, 82 insertions(+), 62 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea0f6e91/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml index 70da9ed..ae24cfe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,27 +40,42 @@ matrix: include: - compiler: gcc os: linux - - compiler: gcc - os: linux - env: PARQUET_BUILD_GROUP=toolchain before_script: - script: - - $TRAVIS_BUILD_DIR/ci/travis_script_static.sh + - export PARQUET_CXXFLAGS="-Werror -DARROW_NO_DEPRECATED_API" + - source $TRAVIS_BUILD_DIR/ci/before_script_travis.sh - compiler: gcc os: linux - env: PARQUET_BUILD_GROUP=toolchain before_script: - script: - - $TRAVIS_BUILD_DIR/ci/travis_script_toolchain.sh + - export PARQUET_CXXFLAGS="-Werror" + - source $TRAVIS_BUILD_DIR/ci/before_script_travis.sh - compiler: clang os: linux + before_script: + - export PARQUET_CXXFLAGS="-Werror -DARROW_NO_DEPRECATED_API" + - source $TRAVIS_BUILD_DIR/ci/before_script_travis.sh - compiler: clang os: osx osx_image: xcode6.4 addons: + before_script: + - export PARQUET_CXXFLAGS="-Werror -DARROW_NO_DEPRECATED_API" + - source $TRAVIS_BUILD_DIR/ci/before_script_travis.sh before_install: - mkdir $TRAVIS_BUILD_DIR/parquet-build - pushd $TRAVIS_BUILD_DIR/parquet-build + - compiler: gcc + os: linux + env: PARQUET_BUILD_GROUP=toolchain + before_script: + script: + - export PARQUET_CXXFLAGS="-Werror -DARROW_NO_DEPRECATED_API" + - $TRAVIS_BUILD_DIR/ci/travis_script_static.sh + - compiler: gcc + os: linux + env: PARQUET_BUILD_GROUP=toolchain + before_script: + script: + - $TRAVIS_BUILD_DIR/ci/travis_script_toolchain.sh language: cpp @@ -83,9 +98,6 @@ before_install: - mkdir $TRAVIS_BUILD_DIR/parquet-build - pushd $TRAVIS_BUILD_DIR/parquet-build -before_script: -- source $TRAVIS_BUILD_DIR/ci/before_script_travis.sh - script: - $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea0f6e91/benchmarks/decode_benchmark.cc ---------------------------------------------------------------------- diff --git a/benchmarks/decode_benchmark.cc b/benchmarks/decode_benchmark.cc index 8df45f7..6fc3c54 100644 --- a/benchmarks/decode_benchmark.cc +++ b/benchmarks/decode_benchmark.cc @@ -19,6 +19,7 @@ #include <iostream> #include <random> +#include "arrow/test-util.h" #include "arrow/util/compression.h" #include "arrow/util/compression_snappy.h" @@ -272,7 +273,7 @@ uint64_t TestBinaryPackedEncoding(const char* name, const std::vector<int64_t>& } } -#define TEST(NAME, FN, DATA, BATCH_SIZE) \ +#define DECODE_TEST(NAME, FN, DATA, BATCH_SIZE) \ sw.Start(); \ for (int i = 0; i < NUM_ITERS; ++i) { \ FN(reinterpret_cast<uint8_t*>(&DATA[0]), NUM_VALUES, BATCH_SIZE); \ @@ -303,8 +304,8 @@ void TestPlainIntCompressed(::arrow::Codec* codec, const std::vector<int64_t>& d sw.Start(); uint64_t r = 0; for (int i = 0; i < num_iters; ++i) { - codec->Decompress(compressed_len, compressed_data, uncompressed_len, - decompressed_data); + ABORT_NOT_OK(codec->Decompress(compressed_len, compressed_data, uncompressed_len, + decompressed_data)); r += TestPlainIntEncoding(decompressed_data, data.size(), batch_size); } int64_t elapsed = sw.Stop(); @@ -437,10 +438,10 @@ int main(int argc, char** argv) { std::vector<int64_t> plain_int_data; plain_int_data.resize(NUM_VALUES); - TEST("Plain decoder", TestPlainIntEncoding, plain_int_data, 1); - TEST("Plain decoder", TestPlainIntEncoding, plain_int_data, 16); - TEST("Plain decoder", TestPlainIntEncoding, plain_int_data, 32); - TEST("Plain decoder", TestPlainIntEncoding, plain_int_data, 64); + DECODE_TEST("Plain decoder", TestPlainIntEncoding, plain_int_data, 1); + DECODE_TEST("Plain decoder", TestPlainIntEncoding, plain_int_data, 16); + DECODE_TEST("Plain decoder", TestPlainIntEncoding, plain_int_data, 32); + DECODE_TEST("Plain decoder", TestPlainIntEncoding, plain_int_data, 64); // Test rand ints between 0 and 10K std::vector<int64_t> values; http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea0f6e91/ci/before_script_travis.sh ---------------------------------------------------------------------- diff --git a/ci/before_script_travis.sh b/ci/before_script_travis.sh index 5b33a9b..c35e232 100755 --- a/ci/before_script_travis.sh +++ b/ci/before_script_travis.sh @@ -27,12 +27,12 @@ fi export PARQUET_TEST_DATA=$TRAVIS_BUILD_DIR/data if [ $TRAVIS_OS_NAME == "linux" ]; then - cmake -DPARQUET_CXXFLAGS=-Werror \ + cmake -DPARQUET_CXXFLAGS="$PARQUET_CXXFLAGS" \ -DPARQUET_TEST_MEMCHECK=ON \ -DPARQUET_BUILD_BENCHMARKS=ON \ -DPARQUET_GENERATE_COVERAGE=1 \ $TRAVIS_BUILD_DIR else - cmake -DPARQUET_CXXFLAGS=-Werror \ + cmake -DPARQUET_CXXFLAGS="$PARQUET_CXXFLAGS" \ $TRAVIS_BUILD_DIR fi http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea0f6e91/ci/msvc-build.bat ---------------------------------------------------------------------- diff --git a/ci/msvc-build.bat b/ci/msvc-build.bat index ad7a7b6..67df565 100644 --- a/ci/msvc-build.bat +++ b/ci/msvc-build.bat @@ -28,7 +28,7 @@ if NOT "%CONFIGURATION%" == "Debug" ( ) if "%CONFIGURATION%" == "Toolchain" ( - conda install -y boost-cpp=1.63 brotli=0.6.0 zlib=1.2.11 snappy=1.1.4 thrift-cpp=0.10.0 -c conda-forge + conda install -y boost-cpp=1.63 brotli=0.6.0 zlib=1.2.11 snappy=1.1.6 thrift-cpp=0.10.0 -c conda-forge set ARROW_BUILD_TOOLCHAIN=%MINICONDA%/Library set PARQUET_BUILD_TOOLCHAIN=%MINICONDA%/Library http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea0f6e91/ci/travis_script_cpp.sh ---------------------------------------------------------------------- diff --git a/ci/travis_script_cpp.sh b/ci/travis_script_cpp.sh index 61d1a51..888b088 100755 --- a/ci/travis_script_cpp.sh +++ b/ci/travis_script_cpp.sh @@ -33,9 +33,9 @@ make lint if [ $TRAVIS_OS_NAME == "linux" ]; then make -j4 || exit 1 ctest -VV -L unittest || { cat $TRAVIS_BUILD_DIR/parquet-build/Testing/Temporary/LastTest.log; exit 1; } - sudo pip install cpp_coveralls - export PARQUET_ROOT=$TRAVIS_BUILD_DIR - $TRAVIS_BUILD_DIR/ci/upload_coverage.sh + # sudo pip install cpp_coveralls + # export PARQUET_ROOT=$TRAVIS_BUILD_DIR + # $TRAVIS_BUILD_DIR/ci/upload_coverage.sh else make -j4 || exit 1 BUILD_TYPE=debug http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea0f6e91/cmake_modules/ThirdpartyToolchain.cmake ---------------------------------------------------------------------- diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake index 34229c8..74e6603 100644 --- a/cmake_modules/ThirdpartyToolchain.cmake +++ b/cmake_modules/ThirdpartyToolchain.cmake @@ -339,7 +339,7 @@ if (NOT ARROW_FOUND) -DARROW_BUILD_TESTS=OFF) if ("$ENV{PARQUET_ARROW_VERSION}" STREQUAL "") - set(ARROW_VERSION "e9f76e125b836d0fdc0a533e2fee3fca8bf4c1a1") + set(ARROW_VERSION "aa5d417bbd32fcdf96462181791f6c044ab3215d") else() set(ARROW_VERSION "$ENV{PARQUET_ARROW_VERSION}") endif() http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea0f6e91/src/parquet/arrow/arrow-reader-writer-benchmark.cc ---------------------------------------------------------------------- diff --git a/src/parquet/arrow/arrow-reader-writer-benchmark.cc b/src/parquet/arrow/arrow-reader-writer-benchmark.cc index 149cc1a..84a6fb3 100644 --- a/src/parquet/arrow/arrow-reader-writer-benchmark.cc +++ b/src/parquet/arrow/arrow-reader-writer-benchmark.cc @@ -29,6 +29,14 @@ using arrow::NumericBuilder; +#define ABORT_NOT_OK(s) \ + do { \ + ::arrow::Status _s = (s); \ + if (ARROW_PREDICT_FALSE(!_s.ok())) { \ + exit(-1); \ + } \ + } while (0); + namespace parquet { using arrow::FileReader; @@ -82,17 +90,17 @@ template <bool nullable, typename ParquetType> std::shared_ptr<::arrow::Table> TableFromVector( const std::vector<typename ParquetType::c_type>& vec) { ::arrow::TypePtr type = std::make_shared<ArrowType<ParquetType>>(); - NumericBuilder<ArrowType<ParquetType>> builder(::arrow::default_memory_pool(), type); + NumericBuilder<ArrowType<ParquetType>> builder(type, ::arrow::default_memory_pool()); if (nullable) { std::vector<uint8_t> valid_bytes(BENCHMARK_SIZE, 0); int n = {0}; std::generate(valid_bytes.begin(), valid_bytes.end(), [&n] { return n++ % 2; }); - builder.Append(vec.data(), vec.size(), valid_bytes.data()); + ABORT_NOT_OK(builder.Append(vec.data(), vec.size(), valid_bytes.data())); } else { - builder.Append(vec.data(), vec.size(), nullptr); + ABORT_NOT_OK(builder.Append(vec.data(), vec.size(), nullptr)); } std::shared_ptr<::arrow::Array> array; - builder.Finish(&array); + ABORT_NOT_OK(builder.Finish(&array)); auto field = std::make_shared<::arrow::Field>("column", type, nullable); auto schema = std::make_shared<::arrow::Schema>( std::vector<std::shared_ptr<::arrow::Field>>({field})); @@ -109,7 +117,8 @@ static void BM_WriteColumn(::benchmark::State& state) { while (state.KeepRunning()) { auto output = std::make_shared<InMemoryOutputStream>(); - WriteTable(*table, ::arrow::default_memory_pool(), output, BENCHMARK_SIZE); + ABORT_NOT_OK( + WriteTable(*table, ::arrow::default_memory_pool(), output, BENCHMARK_SIZE)); } SetBytesProcessed<nullable, ParquetType>(state); } @@ -128,7 +137,8 @@ static void BM_ReadColumn(::benchmark::State& state) { std::vector<typename ParquetType::c_type> values(BENCHMARK_SIZE, 128); std::shared_ptr<::arrow::Table> table = TableFromVector<nullable, ParquetType>(values); auto output = std::make_shared<InMemoryOutputStream>(); - WriteTable(*table, ::arrow::default_memory_pool(), output, BENCHMARK_SIZE); + ABORT_NOT_OK( + WriteTable(*table, ::arrow::default_memory_pool(), output, BENCHMARK_SIZE)); std::shared_ptr<Buffer> buffer = output->GetBuffer(); while (state.KeepRunning()) { @@ -136,7 +146,7 @@ static void BM_ReadColumn(::benchmark::State& state) { ParquetFileReader::Open(std::make_shared<::arrow::io::BufferReader>(buffer)); FileReader filereader(::arrow::default_memory_pool(), std::move(reader)); std::shared_ptr<::arrow::Table> table; - filereader.ReadTable(&table); + ABORT_NOT_OK(filereader.ReadTable(&table)); } SetBytesProcessed<nullable, ParquetType>(state); } http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea0f6e91/src/parquet/arrow/arrow-reader-writer-test.cc ---------------------------------------------------------------------- diff --git a/src/parquet/arrow/arrow-reader-writer-test.cc b/src/parquet/arrow/arrow-reader-writer-test.cc index 69c4991..911a1c1 100644 --- a/src/parquet/arrow/arrow-reader-writer-test.cc +++ b/src/parquet/arrow/arrow-reader-writer-test.cc @@ -715,8 +715,8 @@ TEST_F(TestInt96ParquetIO, ReadIntoTimestamp) { rg_writer->Close(); writer->Close(); - ::arrow::TimestampBuilder builder(default_memory_pool(), - ::arrow::timestamp(TimeUnit::NANO)); + ::arrow::TimestampBuilder builder(::arrow::timestamp(TimeUnit::NANO), + ::arrow::default_memory_pool()); ASSERT_OK(builder.Append(val)); std::shared_ptr<Array> values; ASSERT_OK(builder.Finish(&values)); @@ -788,7 +788,7 @@ using TestStringParquetIO = TestParquetIO<::arrow::StringType>; TEST_F(TestStringParquetIO, EmptyStringColumnRequiredWrite) { std::shared_ptr<Array> values; - ::arrow::StringBuilder builder(::arrow::default_memory_pool()); + ::arrow::StringBuilder builder; for (size_t i = 0; i < SMALL_SIZE; i++) { ASSERT_OK(builder.Append("")); } http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea0f6e91/src/parquet/arrow/reader.cc ---------------------------------------------------------------------- diff --git a/src/parquet/arrow/reader.cc b/src/parquet/arrow/reader.cc index a41ad57..ead2780 100644 --- a/src/parquet/arrow/reader.cc +++ b/src/parquet/arrow/reader.cc @@ -930,9 +930,9 @@ Status PrimitiveImpl::WrapIntoListArray(const int16_t* def_levels, current_field = current_field->type()->child(0); } offset_builders.emplace_back( - std::make_shared<::arrow::Int32Builder>(pool_, ::arrow::int32())); + std::make_shared<::arrow::Int32Builder>(::arrow::int32(), pool_)); valid_bits_builders.emplace_back( - std::make_shared<::arrow::BooleanBuilder>(pool_, ::arrow::boolean())); + std::make_shared<::arrow::BooleanBuilder>(::arrow::boolean(), pool_)); nullable.push_back(current_field->nullable()); } @@ -1224,7 +1224,7 @@ Status PrimitiveImpl::ReadFLBABatch(int batch_size, int byte_width, int16_t* rep_levels = reinterpret_cast<int16_t*>(rep_levels_buffer_.mutable_data()); int values_to_read = batch_size; - BuilderType builder(pool_, ::arrow::fixed_size_binary(byte_width)); + BuilderType builder(::arrow::fixed_size_binary(byte_width), pool_); while ((values_to_read > 0) && column_reader_) { RETURN_NOT_OK(values_buffer_.Resize(values_to_read * sizeof(FLBA), false)); auto reader = dynamic_cast<TypedColumnReader<FLBAType>*>(column_reader_.get()); http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea0f6e91/src/parquet/arrow/test-util.h ---------------------------------------------------------------------- diff --git a/src/parquet/arrow/test-util.h b/src/parquet/arrow/test-util.h index 5980199..954a84f 100644 --- a/src/parquet/arrow/test-util.h +++ b/src/parquet/arrow/test-util.h @@ -54,7 +54,7 @@ typename std::enable_if<is_arrow_float<ArrowType>::value, Status>::type NonNullA size_t size, std::shared_ptr<Array>* out) { std::vector<typename ArrowType::c_type> values; ::arrow::test::random_real<typename ArrowType::c_type>(size, 0, 0, 1, &values); - ::arrow::NumericBuilder<ArrowType> builder(::arrow::default_memory_pool()); + ::arrow::NumericBuilder<ArrowType> builder; RETURN_NOT_OK(builder.Append(values.data(), values.size())); return builder.Finish(out); } @@ -67,8 +67,8 @@ NonNullArray(size_t size, std::shared_ptr<Array>* out) { ::arrow::test::randint<typename ArrowType::c_type>(size, 0, 64, &values); // Passing data type so this will work with TimestampType too - ::arrow::NumericBuilder<ArrowType> builder(::arrow::default_memory_pool(), - std::make_shared<ArrowType>()); + ::arrow::NumericBuilder<ArrowType> builder(std::make_shared<ArrowType>(), + ::arrow::default_memory_pool()); RETURN_NOT_OK(builder.Append(values.data(), values.size())); return builder.Finish(out); } @@ -83,8 +83,8 @@ typename std::enable_if<is_arrow_date<ArrowType>::value, Status>::type NonNullAr } // Passing data type so this will work with TimestampType too - ::arrow::NumericBuilder<ArrowType> builder(::arrow::default_memory_pool(), - std::make_shared<ArrowType>()); + ::arrow::NumericBuilder<ArrowType> builder(std::make_shared<ArrowType>(), + ::arrow::default_memory_pool()); builder.Append(values.data(), values.size()); return builder.Finish(out); } @@ -94,7 +94,7 @@ typename std::enable_if< is_arrow_string<ArrowType>::value || is_arrow_binary<ArrowType>::value, Status>::type NonNullArray(size_t size, std::shared_ptr<Array>* out) { using BuilderType = typename ::arrow::TypeTraits<ArrowType>::BuilderType; - BuilderType builder(::arrow::default_memory_pool()); + BuilderType builder; for (size_t i = 0; i < size; i++) { RETURN_NOT_OK(builder.Append("test-string")); } @@ -107,7 +107,7 @@ NonNullArray(size_t size, std::shared_ptr<Array>* out) { using BuilderType = typename ::arrow::TypeTraits<ArrowType>::BuilderType; // set byte_width to the length of "fixed": 5 // todo: find a way to generate test data with more diversity. - BuilderType builder(::arrow::default_memory_pool(), ::arrow::fixed_size_binary(5)); + BuilderType builder(::arrow::fixed_size_binary(5)); for (size_t i = 0; i < size; i++) { RETURN_NOT_OK(builder.Append("fixed")); } @@ -119,7 +119,7 @@ typename std::enable_if<is_arrow_bool<ArrowType>::value, Status>::type NonNullAr size_t size, std::shared_ptr<Array>* out) { std::vector<uint8_t> values; ::arrow::test::randint<uint8_t>(size, 0, 1, &values); - ::arrow::BooleanBuilder builder(::arrow::default_memory_pool()); + ::arrow::BooleanBuilder builder; RETURN_NOT_OK(builder.Append(values.data(), values.size())); return builder.Finish(out); } @@ -137,7 +137,7 @@ typename std::enable_if<is_arrow_float<ArrowType>::value, Status>::type Nullable valid_bytes[i * 2] = 0; } - ::arrow::NumericBuilder<ArrowType> builder(::arrow::default_memory_pool()); + ::arrow::NumericBuilder<ArrowType> builder; RETURN_NOT_OK(builder.Append(values.data(), values.size(), valid_bytes.data())); return builder.Finish(out); } @@ -159,8 +159,8 @@ NullableArray(size_t size, size_t num_nulls, uint32_t seed, std::shared_ptr<Arra } // Passing data type so this will work with TimestampType too - ::arrow::NumericBuilder<ArrowType> builder(::arrow::default_memory_pool(), - std::make_shared<ArrowType>()); + ::arrow::NumericBuilder<ArrowType> builder(std::make_shared<ArrowType>(), + ::arrow::default_memory_pool()); RETURN_NOT_OK(builder.Append(values.data(), values.size(), valid_bytes.data())); return builder.Finish(out); } @@ -183,8 +183,8 @@ typename std::enable_if<is_arrow_date<ArrowType>::value, Status>::type NullableA } // Passing data type so this will work with TimestampType too - ::arrow::NumericBuilder<ArrowType> builder(::arrow::default_memory_pool(), - std::make_shared<ArrowType>()); + ::arrow::NumericBuilder<ArrowType> builder(std::make_shared<ArrowType>(), + ::arrow::default_memory_pool()); builder.Append(values.data(), values.size(), valid_bytes.data()); return builder.Finish(out); } @@ -202,7 +202,7 @@ NullableArray(size_t size, size_t num_nulls, uint32_t seed, } using BuilderType = typename ::arrow::TypeTraits<ArrowType>::BuilderType; - BuilderType builder(::arrow::default_memory_pool()); + BuilderType builder; const int kBufferSize = 10; uint8_t buffer[kBufferSize]; @@ -231,8 +231,7 @@ NullableArray(size_t size, size_t num_nulls, uint32_t seed, using BuilderType = typename ::arrow::TypeTraits<ArrowType>::BuilderType; const int byte_width = 10; - BuilderType builder(::arrow::default_memory_pool(), - ::arrow::fixed_size_binary(byte_width)); + BuilderType builder(::arrow::fixed_size_binary(byte_width)); const int kBufferSize = byte_width; uint8_t buffer[kBufferSize]; @@ -263,7 +262,7 @@ typename std::enable_if<is_arrow_bool<ArrowType>::value, Status>::type NullableA valid_bytes[i * 2] = 0; } - ::arrow::BooleanBuilder builder(::arrow::default_memory_pool()); + ::arrow::BooleanBuilder builder; RETURN_NOT_OK(builder.Append(values.data(), values.size(), valid_bytes.data())); return builder.Finish(out); } @@ -302,8 +301,7 @@ Status MakeListArray(const std::shared_ptr<Array>& values, int64_t size, } offsets_ptr[size] = static_cast<int32_t>(values->length()); - auto value_field = - std::make_shared<::arrow::Field>("item", values->type(), nullable_values); + auto value_field = ::arrow::field("item", values->type(), nullable_values); *out = std::make_shared<::arrow::ListArray>(::arrow::list(value_field), size, offsets, values, null_bitmap, null_count); @@ -313,14 +311,14 @@ Status MakeListArray(const std::shared_ptr<Array>& values, int64_t size, static std::shared_ptr<::arrow::Column> MakeColumn(const std::string& name, const std::shared_ptr<Array>& array, bool nullable) { - auto field = std::make_shared<::arrow::Field>(name, array->type(), nullable); + auto field = ::arrow::field(name, array->type(), nullable); return std::make_shared<::arrow::Column>(field, array); } static std::shared_ptr<::arrow::Column> MakeColumn( const std::string& name, const std::vector<std::shared_ptr<Array>>& arrays, bool nullable) { - auto field = std::make_shared<::arrow::Field>(name, arrays[0]->type(), nullable); + auto field = ::arrow::field(name, arrays[0]->type(), nullable); return std::make_shared<::arrow::Column>(field, arrays); } @@ -353,8 +351,7 @@ void ExpectArrayT(void* expected, Array* result) { template <> void ExpectArrayT<::arrow::BooleanType>(void* expected, Array* result) { - ::arrow::BooleanBuilder builder(::arrow::default_memory_pool(), - std::make_shared<::arrow::BooleanType>()); + ::arrow::BooleanBuilder builder; EXPECT_OK(builder.Append(reinterpret_cast<uint8_t*>(expected), result->length())); std::shared_ptr<Array> expected_array; http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea0f6e91/src/parquet/arrow/writer.cc ---------------------------------------------------------------------- diff --git a/src/parquet/arrow/writer.cc b/src/parquet/arrow/writer.cc index 41c1146..b096e90 100644 --- a/src/parquet/arrow/writer.cc +++ b/src/parquet/arrow/writer.cc @@ -62,7 +62,7 @@ std::shared_ptr<ArrowWriterProperties> default_arrow_writer_properties() { class LevelBuilder { public: explicit LevelBuilder(MemoryPool* pool) - : def_levels_(pool, ::arrow::int16()), rep_levels_(pool, ::arrow::int16()) { + : def_levels_(::arrow::int16(), pool), rep_levels_(::arrow::int16(), pool) { def_levels_buffer_ = std::make_shared<PoolBuffer>(pool); }
