arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject [2/5] arrow git commit: ARROW-418: [C++] Array / Builder class code reorganization, flattening
Date Mon, 12 Dec 2016 22:17:51 GMT
http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/types/string-test.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/string-test.cc b/cpp/src/arrow/types/string-test.cc
deleted file mode 100644
index 3c4b12b..0000000
--- a/cpp/src/arrow/types/string-test.cc
+++ /dev/null
@@ -1,360 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include <cstdint>
-#include <cstdlib>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-
-#include "arrow/array.h"
-#include "arrow/test-util.h"
-#include "arrow/type.h"
-#include "arrow/types/primitive.h"
-#include "arrow/types/string.h"
-#include "arrow/types/test-common.h"
-
-namespace arrow {
-
-class Buffer;
-
-TEST(TypesTest, BinaryType) {
-  BinaryType t1;
-  BinaryType e1;
-  StringType t2;
-  EXPECT_TRUE(t1.Equals(&e1));
-  EXPECT_FALSE(t1.Equals(&t2));
-  ASSERT_EQ(t1.type, Type::BINARY);
-  ASSERT_EQ(t1.ToString(), std::string("binary"));
-}
-
-TEST(TypesTest, TestStringType) {
-  StringType str;
-  ASSERT_EQ(str.type, Type::STRING);
-  ASSERT_EQ(str.ToString(), std::string("string"));
-}
-
-// ----------------------------------------------------------------------
-// String container
-
-class TestStringContainer : public ::testing::Test {
- public:
-  void SetUp() {
-    chars_ = {'a', 'b', 'b', 'c', 'c', 'c'};
-    offsets_ = {0, 1, 1, 1, 3, 6};
-    valid_bytes_ = {1, 1, 0, 1, 1};
-    expected_ = {"a", "", "", "bb", "ccc"};
-
-    MakeArray();
-  }
-
-  void MakeArray() {
-    length_ = offsets_.size() - 1;
-    value_buf_ = test::GetBufferFromVector(chars_);
-    offsets_buf_ = test::GetBufferFromVector(offsets_);
-    null_bitmap_ = test::bytes_to_null_buffer(valid_bytes_);
-    null_count_ = test::null_count(valid_bytes_);
-
-    strings_ = std::make_shared<StringArray>(
-        length_, offsets_buf_, value_buf_, null_count_, null_bitmap_);
-  }
-
- protected:
-  std::vector<int32_t> offsets_;
-  std::vector<char> chars_;
-  std::vector<uint8_t> valid_bytes_;
-
-  std::vector<std::string> expected_;
-
-  std::shared_ptr<Buffer> value_buf_;
-  std::shared_ptr<Buffer> offsets_buf_;
-  std::shared_ptr<Buffer> null_bitmap_;
-
-  int null_count_;
-  int length_;
-
-  std::shared_ptr<StringArray> strings_;
-};
-
-TEST_F(TestStringContainer, TestArrayBasics) {
-  ASSERT_EQ(length_, strings_->length());
-  ASSERT_EQ(1, strings_->null_count());
-  ASSERT_OK(strings_->Validate());
-}
-
-TEST_F(TestStringContainer, TestType) {
-  TypePtr type = strings_->type();
-
-  ASSERT_EQ(Type::STRING, type->type);
-  ASSERT_EQ(Type::STRING, strings_->type_enum());
-}
-
-TEST_F(TestStringContainer, TestListFunctions) {
-  int pos = 0;
-  for (size_t i = 0; i < expected_.size(); ++i) {
-    ASSERT_EQ(pos, strings_->value_offset(i));
-    ASSERT_EQ(static_cast<int>(expected_[i].size()), strings_->value_length(i));
-    pos += expected_[i].size();
-  }
-}
-
-TEST_F(TestStringContainer, TestDestructor) {
-  auto arr = std::make_shared<StringArray>(
-      length_, offsets_buf_, value_buf_, null_count_, null_bitmap_);
-}
-
-TEST_F(TestStringContainer, TestGetString) {
-  for (size_t i = 0; i < expected_.size(); ++i) {
-    if (valid_bytes_[i] == 0) {
-      ASSERT_TRUE(strings_->IsNull(i));
-    } else {
-      ASSERT_EQ(expected_[i], strings_->GetString(i));
-    }
-  }
-}
-
-TEST_F(TestStringContainer, TestEmptyStringComparison) {
-  offsets_ = {0, 0, 0, 0, 0, 0};
-  offsets_buf_ = test::GetBufferFromVector(offsets_);
-  length_ = offsets_.size() - 1;
-
-  auto strings_a = std::make_shared<StringArray>(
-      length_, offsets_buf_, nullptr, null_count_, null_bitmap_);
-  auto strings_b = std::make_shared<StringArray>(
-      length_, offsets_buf_, nullptr, null_count_, null_bitmap_);
-  ASSERT_TRUE(strings_a->Equals(strings_b));
-}
-
-// ----------------------------------------------------------------------
-// String builder tests
-
-class TestStringBuilder : public TestBuilder {
- public:
-  void SetUp() {
-    TestBuilder::SetUp();
-    type_ = TypePtr(new StringType());
-    builder_.reset(new StringBuilder(pool_, type_));
-  }
-
-  void Done() {
-    std::shared_ptr<Array> out;
-    EXPECT_OK(builder_->Finish(&out));
-
-    result_ = std::dynamic_pointer_cast<StringArray>(out);
-    result_->Validate();
-  }
-
- protected:
-  TypePtr type_;
-
-  std::unique_ptr<StringBuilder> builder_;
-  std::shared_ptr<StringArray> result_;
-};
-
-TEST_F(TestStringBuilder, TestScalarAppend) {
-  std::vector<std::string> strings = {"", "bb", "a", "", "ccc"};
-  std::vector<uint8_t> is_null = {0, 0, 0, 1, 0};
-
-  int N = strings.size();
-  int reps = 1000;
-
-  for (int j = 0; j < reps; ++j) {
-    for (int i = 0; i < N; ++i) {
-      if (is_null[i]) {
-        builder_->AppendNull();
-      } else {
-        builder_->Append(strings[i]);
-      }
-    }
-  }
-  Done();
-
-  ASSERT_EQ(reps * N, result_->length());
-  ASSERT_EQ(reps, result_->null_count());
-  ASSERT_EQ(reps * 6, result_->data()->size());
-
-  int32_t length;
-  int32_t pos = 0;
-  for (int i = 0; i < N * reps; ++i) {
-    if (is_null[i % N]) {
-      ASSERT_TRUE(result_->IsNull(i));
-    } else {
-      ASSERT_FALSE(result_->IsNull(i));
-      result_->GetValue(i, &length);
-      ASSERT_EQ(pos, result_->offset(i));
-      ASSERT_EQ(static_cast<int>(strings[i % N].size()), length);
-      ASSERT_EQ(strings[i % N], result_->GetString(i));
-
-      pos += length;
-    }
-  }
-}
-
-TEST_F(TestStringBuilder, TestZeroLength) {
-  // All buffers are null
-  Done();
-}
-
-// Binary container type
-// TODO(emkornfield) there should be some way to refactor these to avoid code duplicating
-// with String
-class TestBinaryContainer : public ::testing::Test {
- public:
-  void SetUp() {
-    chars_ = {'a', 'b', 'b', 'c', 'c', 'c'};
-    offsets_ = {0, 1, 1, 1, 3, 6};
-    valid_bytes_ = {1, 1, 0, 1, 1};
-    expected_ = {"a", "", "", "bb", "ccc"};
-
-    MakeArray();
-  }
-
-  void MakeArray() {
-    length_ = offsets_.size() - 1;
-    value_buf_ = test::GetBufferFromVector(chars_);
-    offsets_buf_ = test::GetBufferFromVector(offsets_);
-
-    null_bitmap_ = test::bytes_to_null_buffer(valid_bytes_);
-    null_count_ = test::null_count(valid_bytes_);
-
-    strings_ = std::make_shared<BinaryArray>(
-        length_, offsets_buf_, value_buf_, null_count_, null_bitmap_);
-  }
-
- protected:
-  std::vector<int32_t> offsets_;
-  std::vector<char> chars_;
-  std::vector<uint8_t> valid_bytes_;
-
-  std::vector<std::string> expected_;
-
-  std::shared_ptr<Buffer> value_buf_;
-  std::shared_ptr<Buffer> offsets_buf_;
-  std::shared_ptr<Buffer> null_bitmap_;
-
-  int null_count_;
-  int length_;
-
-  std::shared_ptr<BinaryArray> strings_;
-};
-
-TEST_F(TestBinaryContainer, TestArrayBasics) {
-  ASSERT_EQ(length_, strings_->length());
-  ASSERT_EQ(1, strings_->null_count());
-  ASSERT_OK(strings_->Validate());
-}
-
-TEST_F(TestBinaryContainer, TestType) {
-  TypePtr type = strings_->type();
-
-  ASSERT_EQ(Type::BINARY, type->type);
-  ASSERT_EQ(Type::BINARY, strings_->type_enum());
-}
-
-TEST_F(TestBinaryContainer, TestListFunctions) {
-  int pos = 0;
-  for (size_t i = 0; i < expected_.size(); ++i) {
-    ASSERT_EQ(pos, strings_->value_offset(i));
-    ASSERT_EQ(static_cast<int>(expected_[i].size()), strings_->value_length(i));
-    pos += expected_[i].size();
-  }
-}
-
-TEST_F(TestBinaryContainer, TestDestructor) {
-  auto arr = std::make_shared<BinaryArray>(
-      length_, offsets_buf_, value_buf_, null_count_, null_bitmap_);
-}
-
-TEST_F(TestBinaryContainer, TestGetValue) {
-  for (size_t i = 0; i < expected_.size(); ++i) {
-    if (valid_bytes_[i] == 0) {
-      ASSERT_TRUE(strings_->IsNull(i));
-    } else {
-      int32_t len = -1;
-      const uint8_t* bytes = strings_->GetValue(i, &len);
-      ASSERT_EQ(0, std::memcmp(expected_[i].data(), bytes, len));
-    }
-  }
-}
-
-class TestBinaryBuilder : public TestBuilder {
- public:
-  void SetUp() {
-    TestBuilder::SetUp();
-    type_ = TypePtr(new BinaryType());
-    builder_.reset(new BinaryBuilder(pool_, type_));
-  }
-
-  void Done() {
-    std::shared_ptr<Array> out;
-    EXPECT_OK(builder_->Finish(&out));
-
-    result_ = std::dynamic_pointer_cast<BinaryArray>(out);
-    result_->Validate();
-  }
-
- protected:
-  TypePtr type_;
-
-  std::unique_ptr<BinaryBuilder> builder_;
-  std::shared_ptr<BinaryArray> result_;
-};
-
-TEST_F(TestBinaryBuilder, TestScalarAppend) {
-  std::vector<std::string> strings = {"", "bb", "a", "", "ccc"};
-  std::vector<uint8_t> is_null = {0, 0, 0, 1, 0};
-
-  int N = strings.size();
-  int reps = 1000;
-
-  for (int j = 0; j < reps; ++j) {
-    for (int i = 0; i < N; ++i) {
-      if (is_null[i]) {
-        builder_->AppendNull();
-      } else {
-        builder_->Append(
-            reinterpret_cast<const uint8_t*>(strings[i].data()), strings[i].size());
-      }
-    }
-  }
-  Done();
-  ASSERT_OK(result_->Validate());
-  ASSERT_EQ(reps * N, result_->length());
-  ASSERT_EQ(reps, result_->null_count());
-  ASSERT_EQ(reps * 6, result_->data()->size());
-
-  int32_t length;
-  for (int i = 0; i < N * reps; ++i) {
-    if (is_null[i % N]) {
-      ASSERT_TRUE(result_->IsNull(i));
-    } else {
-      ASSERT_FALSE(result_->IsNull(i));
-      const uint8_t* vals = result_->GetValue(i, &length);
-      ASSERT_EQ(static_cast<int>(strings[i % N].size()), length);
-      ASSERT_EQ(0, std::memcmp(vals, strings[i % N].data(), length));
-    }
-  }
-}
-
-TEST_F(TestBinaryBuilder, TestZeroLength) {
-  // All buffers are null
-  Done();
-}
-
-}  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/types/string.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/string.cc b/cpp/src/arrow/types/string.cc
deleted file mode 100644
index db963df..0000000
--- a/cpp/src/arrow/types/string.cc
+++ /dev/null
@@ -1,150 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include "arrow/types/string.h"
-
-#include <cstring>
-#include <sstream>
-#include <string>
-
-#include "arrow/type.h"
-
-namespace arrow {
-
-static std::shared_ptr<DataType> kBinary = std::make_shared<BinaryType>();
-static std::shared_ptr<DataType> kString = std::make_shared<StringType>();
-
-BinaryArray::BinaryArray(int32_t length, const std::shared_ptr<Buffer>& offsets,
-    const std::shared_ptr<Buffer>& data, int32_t null_count,
-    const std::shared_ptr<Buffer>& null_bitmap)
-    : BinaryArray(kBinary, length, offsets, data, null_count, null_bitmap) {}
-
-BinaryArray::BinaryArray(const TypePtr& type, int32_t length,
-    const std::shared_ptr<Buffer>& offsets, const std::shared_ptr<Buffer>& data,
-    int32_t null_count, const std::shared_ptr<Buffer>& null_bitmap)
-    : Array(type, length, null_count, null_bitmap),
-      offset_buffer_(offsets),
-      offsets_(reinterpret_cast<const int32_t*>(offset_buffer_->data())),
-      data_buffer_(data),
-      data_(nullptr) {
-  if (data_buffer_ != nullptr) { data_ = data_buffer_->data(); }
-}
-
-Status BinaryArray::Validate() const {
-  // TODO(wesm): what to do here?
-  return Status::OK();
-}
-
-bool BinaryArray::EqualsExact(const BinaryArray& other) const {
-  if (!Array::EqualsExact(other)) { return false; }
-
-  bool equal_offsets =
-      offset_buffer_->Equals(*other.offset_buffer_, (length_ + 1) * sizeof(int32_t));
-  if (!equal_offsets) { return false; }
-
-  if (!data_buffer_ && !(other.data_buffer_)) { return true; }
-
-  return data_buffer_->Equals(*other.data_buffer_, data_buffer_->size());
-}
-
-bool BinaryArray::Equals(const std::shared_ptr<Array>& arr) const {
-  if (this == arr.get()) { return true; }
-  if (this->type_enum() != arr->type_enum()) { return false; }
-  return EqualsExact(*static_cast<const BinaryArray*>(arr.get()));
-}
-
-bool BinaryArray::RangeEquals(int32_t start_idx, int32_t end_idx, int32_t other_start_idx,
-    const std::shared_ptr<Array>& arr) const {
-  if (this == arr.get()) { return true; }
-  if (!arr) { return false; }
-  if (this->type_enum() != arr->type_enum()) { return false; }
-  const auto other = static_cast<const BinaryArray*>(arr.get());
-  for (int32_t i = start_idx, o_i = other_start_idx; i < end_idx; ++i, ++o_i) {
-    const bool is_null = IsNull(i);
-    if (is_null != arr->IsNull(o_i)) { return false; }
-    if (is_null) continue;
-    const int32_t begin_offset = offset(i);
-    const int32_t end_offset = offset(i + 1);
-    const int32_t other_begin_offset = other->offset(o_i);
-    const int32_t other_end_offset = other->offset(o_i + 1);
-    // Underlying can't be equal if the size isn't equal
-    if (end_offset - begin_offset != other_end_offset - other_begin_offset) {
-      return false;
-    }
-
-    if (std::memcmp(data_ + begin_offset, other->data_ + other_begin_offset,
-            end_offset - begin_offset)) {
-      return false;
-    }
-  }
-  return true;
-}
-
-Status BinaryArray::Accept(ArrayVisitor* visitor) const {
-  return visitor->Visit(*this);
-}
-
-StringArray::StringArray(int32_t length, const std::shared_ptr<Buffer>& offsets,
-    const std::shared_ptr<Buffer>& data, int32_t null_count,
-    const std::shared_ptr<Buffer>& null_bitmap)
-    : BinaryArray(kString, length, offsets, data, null_count, null_bitmap) {}
-
-Status StringArray::Validate() const {
-  // TODO(emkornfield) Validate proper UTF8 code points?
-  return BinaryArray::Validate();
-}
-
-Status StringArray::Accept(ArrayVisitor* visitor) const {
-  return visitor->Visit(*this);
-}
-
-// This used to be a static member variable of BinaryBuilder, but it can cause
-// valgrind to report a (spurious?) memory leak when needed in other shared
-// libraries. The problem came up while adding explicit visibility to libarrow
-// and libparquet_arrow
-static TypePtr kBinaryValueType = TypePtr(new UInt8Type());
-
-BinaryBuilder::BinaryBuilder(MemoryPool* pool, const TypePtr& type)
-    : ListBuilder(pool, std::make_shared<UInt8Builder>(pool, kBinaryValueType), type) {
-  byte_builder_ = static_cast<UInt8Builder*>(value_builder_.get());
-}
-
-Status BinaryBuilder::Finish(std::shared_ptr<Array>* out) {
-  std::shared_ptr<Array> result;
-  RETURN_NOT_OK(ListBuilder::Finish(&result));
-
-  const auto list = std::dynamic_pointer_cast<ListArray>(result);
-  auto values = std::dynamic_pointer_cast<UInt8Array>(list->values());
-
-  *out = std::make_shared<BinaryArray>(list->length(), list->offsets(), values->data(),
-      list->null_count(), list->null_bitmap());
-  return Status::OK();
-}
-
-Status StringBuilder::Finish(std::shared_ptr<Array>* out) {
-  std::shared_ptr<Array> result;
-  RETURN_NOT_OK(ListBuilder::Finish(&result));
-
-  const auto list = std::dynamic_pointer_cast<ListArray>(result);
-  auto values = std::dynamic_pointer_cast<UInt8Array>(list->values());
-
-  *out = std::make_shared<StringArray>(list->length(), list->offsets(), values->data(),
-      list->null_count(), list->null_bitmap());
-  return Status::OK();
-}
-
-}  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/types/string.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/string.h b/cpp/src/arrow/types/string.h
deleted file mode 100644
index c875243..0000000
--- a/cpp/src/arrow/types/string.h
+++ /dev/null
@@ -1,149 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#ifndef ARROW_TYPES_STRING_H
-#define ARROW_TYPES_STRING_H
-
-#include <cstdint>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "arrow/array.h"
-#include "arrow/type.h"
-#include "arrow/types/list.h"
-#include "arrow/types/primitive.h"
-#include "arrow/util/status.h"
-#include "arrow/util/visibility.h"
-
-namespace arrow {
-
-class Buffer;
-class MemoryPool;
-
-class ARROW_EXPORT BinaryArray : public Array {
- public:
-  using TypeClass = BinaryType;
-
-  BinaryArray(int32_t length, const std::shared_ptr<Buffer>& offsets,
-      const std::shared_ptr<Buffer>& data, int32_t null_count = 0,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr);
-
-  // Constructor that allows sub-classes/builders to propagate there logical type up the
-  // class hierarchy.
-  BinaryArray(const TypePtr& type, int32_t length, const std::shared_ptr<Buffer>& offsets,
-      const std::shared_ptr<Buffer>& data, int32_t null_count = 0,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr);
-
-  // Return the pointer to the given elements bytes
-  // TODO(emkornfield) introduce a StringPiece or something similar to capture zero-copy
-  // pointer + offset
-  const uint8_t* GetValue(int i, int32_t* out_length) const {
-    DCHECK(out_length);
-    const int32_t pos = offsets_[i];
-    *out_length = offsets_[i + 1] - pos;
-    return data_ + pos;
-  }
-
-  std::shared_ptr<Buffer> data() const { return data_buffer_; }
-  std::shared_ptr<Buffer> offsets() const { return offset_buffer_; }
-
-  const int32_t* raw_offsets() const { return offsets_; }
-
-  int32_t offset(int i) const { return offsets_[i]; }
-
-  // Neither of these functions will perform boundschecking
-  int32_t value_offset(int i) const { return offsets_[i]; }
-  int32_t value_length(int i) const { return offsets_[i + 1] - offsets_[i]; }
-
-  bool EqualsExact(const BinaryArray& other) const;
-  bool Equals(const std::shared_ptr<Array>& arr) const override;
-  bool RangeEquals(int32_t start_idx, int32_t end_idx, int32_t other_start_idx,
-      const ArrayPtr& arr) const override;
-
-  Status Validate() const override;
-
-  Status Accept(ArrayVisitor* visitor) const override;
-
- private:
-  std::shared_ptr<Buffer> offset_buffer_;
-  const int32_t* offsets_;
-
-  std::shared_ptr<Buffer> data_buffer_;
-  const uint8_t* data_;
-};
-
-class ARROW_EXPORT StringArray : public BinaryArray {
- public:
-  using TypeClass = StringType;
-
-  StringArray(int32_t length, const std::shared_ptr<Buffer>& offsets,
-      const std::shared_ptr<Buffer>& data, int32_t null_count = 0,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr);
-
-  // Construct a std::string
-  // TODO: std::bad_alloc possibility
-  std::string GetString(int i) const {
-    int32_t nchars;
-    const uint8_t* str = GetValue(i, &nchars);
-    return std::string(reinterpret_cast<const char*>(str), nchars);
-  }
-
-  Status Validate() const override;
-
-  Status Accept(ArrayVisitor* visitor) const override;
-};
-
-// BinaryBuilder : public ListBuilder
-class ARROW_EXPORT BinaryBuilder : public ListBuilder {
- public:
-  explicit BinaryBuilder(MemoryPool* pool, const TypePtr& type);
-  virtual ~BinaryBuilder() {}
-
-  Status Append(const uint8_t* value, int32_t length) {
-    RETURN_NOT_OK(ListBuilder::Append());
-    return byte_builder_->Append(value, length);
-  }
-
-  Status Append(const char* value, int32_t length) {
-    return Append(reinterpret_cast<const uint8_t*>(value), length);
-  }
-
-  Status Append(const std::string& value) { return Append(value.c_str(), value.size()); }
-
-  Status Finish(std::shared_ptr<Array>* out) override;
-
- protected:
-  UInt8Builder* byte_builder_;
-};
-
-// String builder
-class ARROW_EXPORT StringBuilder : public BinaryBuilder {
- public:
-  explicit StringBuilder(MemoryPool* pool, const TypePtr& type)
-      : BinaryBuilder(pool, type) {}
-
-  using BinaryBuilder::Append;
-
-  Status Finish(std::shared_ptr<Array>* out) override;
-
-  Status Append(const std::vector<std::string>& values, uint8_t* null_bytes);
-};
-
-}  // namespace arrow
-
-#endif  // ARROW_TYPES_STRING_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/types/struct-test.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/struct-test.cc b/cpp/src/arrow/types/struct-test.cc
deleted file mode 100644
index 197d7d4..0000000
--- a/cpp/src/arrow/types/struct-test.cc
+++ /dev/null
@@ -1,396 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-
-#include "arrow/array.h"
-#include "arrow/builder.h"
-#include "arrow/test-util.h"
-#include "arrow/type.h"
-#include "arrow/types/construct.h"
-#include "arrow/types/list.h"
-#include "arrow/types/primitive.h"
-#include "arrow/types/struct.h"
-#include "arrow/types/test-common.h"
-#include "arrow/util/status.h"
-
-using std::shared_ptr;
-using std::string;
-using std::vector;
-
-namespace arrow {
-
-TEST(TestStructType, Basics) {
-  TypePtr f0_type = TypePtr(new Int32Type());
-  auto f0 = std::make_shared<Field>("f0", f0_type);
-
-  TypePtr f1_type = TypePtr(new StringType());
-  auto f1 = std::make_shared<Field>("f1", f1_type);
-
-  TypePtr f2_type = TypePtr(new UInt8Type());
-  auto f2 = std::make_shared<Field>("f2", f2_type);
-
-  vector<shared_ptr<Field>> fields = {f0, f1, f2};
-
-  StructType struct_type(fields);
-
-  ASSERT_TRUE(struct_type.child(0)->Equals(f0));
-  ASSERT_TRUE(struct_type.child(1)->Equals(f1));
-  ASSERT_TRUE(struct_type.child(2)->Equals(f2));
-
-  ASSERT_EQ(struct_type.ToString(), "struct<f0: int32, f1: string, f2: uint8>");
-
-  // TODO(wesm): out of bounds for field(...)
-}
-
-void ValidateBasicStructArray(const StructArray* result,
-    const vector<uint8_t>& struct_is_valid, const vector<char>& list_values,
-    const vector<uint8_t>& list_is_valid, const vector<int>& list_lengths,
-    const vector<int>& list_offsets, const vector<int32_t>& int_values) {
-  ASSERT_EQ(4, result->length());
-  ASSERT_OK(result->Validate());
-
-  auto list_char_arr = static_cast<ListArray*>(result->field(0).get());
-  auto char_arr = static_cast<Int8Array*>(list_char_arr->values().get());
-  auto int32_arr = static_cast<Int32Array*>(result->field(1).get());
-
-  ASSERT_EQ(0, result->null_count());
-  ASSERT_EQ(1, list_char_arr->null_count());
-  ASSERT_EQ(0, int32_arr->null_count());
-
-  // List<char>
-  ASSERT_EQ(4, list_char_arr->length());
-  ASSERT_EQ(10, list_char_arr->values()->length());
-  for (size_t i = 0; i < list_offsets.size(); ++i) {
-    ASSERT_EQ(list_offsets[i], list_char_arr->raw_offsets()[i]);
-  }
-  for (size_t i = 0; i < list_values.size(); ++i) {
-    ASSERT_EQ(list_values[i], char_arr->Value(i));
-  }
-
-  // Int32
-  ASSERT_EQ(4, int32_arr->length());
-  for (size_t i = 0; i < int_values.size(); ++i) {
-    ASSERT_EQ(int_values[i], int32_arr->Value(i));
-  }
-}
-
-// ----------------------------------------------------------------------------------
-// Struct test
-class TestStructBuilder : public TestBuilder {
- public:
-  void SetUp() {
-    TestBuilder::SetUp();
-
-    auto int32_type = TypePtr(new Int32Type());
-    auto char_type = TypePtr(new Int8Type());
-    auto list_type = TypePtr(new ListType(char_type));
-
-    std::vector<TypePtr> types = {list_type, int32_type};
-    std::vector<FieldPtr> fields;
-    fields.push_back(FieldPtr(new Field("list", list_type)));
-    fields.push_back(FieldPtr(new Field("int", int32_type)));
-
-    type_ = TypePtr(new StructType(fields));
-    value_fields_ = fields;
-
-    std::shared_ptr<ArrayBuilder> tmp;
-    ASSERT_OK(MakeBuilder(pool_, type_, &tmp));
-
-    builder_ = std::dynamic_pointer_cast<StructBuilder>(tmp);
-    ASSERT_EQ(2, static_cast<int>(builder_->field_builders().size()));
-  }
-
-  void Done() {
-    std::shared_ptr<Array> out;
-    ASSERT_OK(builder_->Finish(&out));
-    result_ = std::dynamic_pointer_cast<StructArray>(out);
-  }
-
- protected:
-  std::vector<FieldPtr> value_fields_;
-  TypePtr type_;
-
-  std::shared_ptr<StructBuilder> builder_;
-  std::shared_ptr<StructArray> result_;
-};
-
-TEST_F(TestStructBuilder, TestAppendNull) {
-  ASSERT_OK(builder_->AppendNull());
-  ASSERT_OK(builder_->AppendNull());
-  ASSERT_EQ(2, static_cast<int>(builder_->field_builders().size()));
-
-  ListBuilder* list_vb = static_cast<ListBuilder*>(builder_->field_builder(0).get());
-  ASSERT_OK(list_vb->AppendNull());
-  ASSERT_OK(list_vb->AppendNull());
-  ASSERT_EQ(2, list_vb->length());
-
-  Int32Builder* int_vb = static_cast<Int32Builder*>(builder_->field_builder(1).get());
-  ASSERT_OK(int_vb->AppendNull());
-  ASSERT_OK(int_vb->AppendNull());
-  ASSERT_EQ(2, int_vb->length());
-
-  Done();
-
-  ASSERT_OK(result_->Validate());
-
-  ASSERT_EQ(2, static_cast<int>(result_->fields().size()));
-  ASSERT_EQ(2, result_->length());
-  ASSERT_EQ(2, result_->field(0)->length());
-  ASSERT_EQ(2, result_->field(1)->length());
-  ASSERT_TRUE(result_->IsNull(0));
-  ASSERT_TRUE(result_->IsNull(1));
-  ASSERT_TRUE(result_->field(0)->IsNull(0));
-  ASSERT_TRUE(result_->field(0)->IsNull(1));
-  ASSERT_TRUE(result_->field(1)->IsNull(0));
-  ASSERT_TRUE(result_->field(1)->IsNull(1));
-
-  ASSERT_EQ(Type::LIST, result_->field(0)->type_enum());
-  ASSERT_EQ(Type::INT32, result_->field(1)->type_enum());
-}
-
-TEST_F(TestStructBuilder, TestBasics) {
-  vector<int32_t> int_values = {1, 2, 3, 4};
-  vector<char> list_values = {'j', 'o', 'e', 'b', 'o', 'b', 'm', 'a', 'r', 'k'};
-  vector<int> list_lengths = {3, 0, 3, 4};
-  vector<int> list_offsets = {0, 3, 3, 6, 10};
-  vector<uint8_t> list_is_valid = {1, 0, 1, 1};
-  vector<uint8_t> struct_is_valid = {1, 1, 1, 1};
-
-  ListBuilder* list_vb = static_cast<ListBuilder*>(builder_->field_builder(0).get());
-  Int8Builder* char_vb = static_cast<Int8Builder*>(list_vb->value_builder().get());
-  Int32Builder* int_vb = static_cast<Int32Builder*>(builder_->field_builder(1).get());
-  ASSERT_EQ(2, static_cast<int>(builder_->field_builders().size()));
-
-  EXPECT_OK(builder_->Resize(list_lengths.size()));
-  EXPECT_OK(char_vb->Resize(list_values.size()));
-  EXPECT_OK(int_vb->Resize(int_values.size()));
-
-  int pos = 0;
-  for (size_t i = 0; i < list_lengths.size(); ++i) {
-    ASSERT_OK(list_vb->Append(list_is_valid[i] > 0));
-    int_vb->UnsafeAppend(int_values[i]);
-    for (int j = 0; j < list_lengths[i]; ++j) {
-      char_vb->UnsafeAppend(list_values[pos++]);
-    }
-  }
-
-  for (size_t i = 0; i < struct_is_valid.size(); ++i) {
-    ASSERT_OK(builder_->Append(struct_is_valid[i] > 0));
-  }
-
-  Done();
-
-  ValidateBasicStructArray(result_.get(), struct_is_valid, list_values, list_is_valid,
-      list_lengths, list_offsets, int_values);
-}
-
-TEST_F(TestStructBuilder, BulkAppend) {
-  vector<int32_t> int_values = {1, 2, 3, 4};
-  vector<char> list_values = {'j', 'o', 'e', 'b', 'o', 'b', 'm', 'a', 'r', 'k'};
-  vector<int> list_lengths = {3, 0, 3, 4};
-  vector<int> list_offsets = {0, 3, 3, 6};
-  vector<uint8_t> list_is_valid = {1, 0, 1, 1};
-  vector<uint8_t> struct_is_valid = {1, 1, 1, 1};
-
-  ListBuilder* list_vb = static_cast<ListBuilder*>(builder_->field_builder(0).get());
-  Int8Builder* char_vb = static_cast<Int8Builder*>(list_vb->value_builder().get());
-  Int32Builder* int_vb = static_cast<Int32Builder*>(builder_->field_builder(1).get());
-
-  ASSERT_OK(builder_->Resize(list_lengths.size()));
-  ASSERT_OK(char_vb->Resize(list_values.size()));
-  ASSERT_OK(int_vb->Resize(int_values.size()));
-
-  builder_->Append(struct_is_valid.size(), struct_is_valid.data());
-
-  list_vb->Append(list_offsets.data(), list_offsets.size(), list_is_valid.data());
-  for (int8_t value : list_values) {
-    char_vb->UnsafeAppend(value);
-  }
-  for (int32_t value : int_values) {
-    int_vb->UnsafeAppend(value);
-  }
-
-  Done();
-  ValidateBasicStructArray(result_.get(), struct_is_valid, list_values, list_is_valid,
-      list_lengths, list_offsets, int_values);
-}
-
-TEST_F(TestStructBuilder, BulkAppendInvalid) {
-  vector<int32_t> int_values = {1, 2, 3, 4};
-  vector<char> list_values = {'j', 'o', 'e', 'b', 'o', 'b', 'm', 'a', 'r', 'k'};
-  vector<int> list_lengths = {3, 0, 3, 4};
-  vector<int> list_offsets = {0, 3, 3, 6};
-  vector<uint8_t> list_is_valid = {1, 0, 1, 1};
-  vector<uint8_t> struct_is_valid = {1, 0, 1, 1};  // should be 1, 1, 1, 1
-
-  ListBuilder* list_vb = static_cast<ListBuilder*>(builder_->field_builder(0).get());
-  Int8Builder* char_vb = static_cast<Int8Builder*>(list_vb->value_builder().get());
-  Int32Builder* int_vb = static_cast<Int32Builder*>(builder_->field_builder(1).get());
-
-  ASSERT_OK(builder_->Reserve(list_lengths.size()));
-  ASSERT_OK(char_vb->Reserve(list_values.size()));
-  ASSERT_OK(int_vb->Reserve(int_values.size()));
-
-  builder_->Append(struct_is_valid.size(), struct_is_valid.data());
-
-  list_vb->Append(list_offsets.data(), list_offsets.size(), list_is_valid.data());
-  for (int8_t value : list_values) {
-    char_vb->UnsafeAppend(value);
-  }
-  for (int32_t value : int_values) {
-    int_vb->UnsafeAppend(value);
-  }
-
-  Done();
-  // Even null bitmap of the parent Struct is not valid, Validate() will ignore it.
-  ASSERT_OK(result_->Validate());
-}
-
-TEST_F(TestStructBuilder, TestEquality) {
-  ArrayPtr array, equal_array;
-  ArrayPtr unequal_bitmap_array, unequal_offsets_array, unequal_values_array;
-
-  vector<int32_t> int_values = {1, 2, 3, 4};
-  vector<char> list_values = {'j', 'o', 'e', 'b', 'o', 'b', 'm', 'a', 'r', 'k'};
-  vector<int> list_lengths = {3, 0, 3, 4};
-  vector<int> list_offsets = {0, 3, 3, 6};
-  vector<uint8_t> list_is_valid = {1, 0, 1, 1};
-  vector<uint8_t> struct_is_valid = {1, 1, 1, 1};
-
-  vector<int32_t> unequal_int_values = {4, 2, 3, 1};
-  vector<char> unequal_list_values = {'j', 'o', 'e', 'b', 'o', 'b', 'l', 'u', 'c', 'y'};
-  vector<int> unequal_list_offsets = {0, 3, 4, 6};
-  vector<uint8_t> unequal_list_is_valid = {1, 1, 1, 1};
-  vector<uint8_t> unequal_struct_is_valid = {1, 0, 0, 1};
-
-  ListBuilder* list_vb = static_cast<ListBuilder*>(builder_->field_builder(0).get());
-  Int8Builder* char_vb = static_cast<Int8Builder*>(list_vb->value_builder().get());
-  Int32Builder* int_vb = static_cast<Int32Builder*>(builder_->field_builder(1).get());
-  ASSERT_OK(builder_->Reserve(list_lengths.size()));
-  ASSERT_OK(char_vb->Reserve(list_values.size()));
-  ASSERT_OK(int_vb->Reserve(int_values.size()));
-
-  // setup two equal arrays, one of which takes an unequal bitmap
-  builder_->Append(struct_is_valid.size(), struct_is_valid.data());
-  list_vb->Append(list_offsets.data(), list_offsets.size(), list_is_valid.data());
-  for (int8_t value : list_values) {
-    char_vb->UnsafeAppend(value);
-  }
-  for (int32_t value : int_values) {
-    int_vb->UnsafeAppend(value);
-  }
-
-  ASSERT_OK(builder_->Finish(&array));
-
-  ASSERT_OK(builder_->Resize(list_lengths.size()));
-  ASSERT_OK(char_vb->Resize(list_values.size()));
-  ASSERT_OK(int_vb->Resize(int_values.size()));
-
-  builder_->Append(struct_is_valid.size(), struct_is_valid.data());
-  list_vb->Append(list_offsets.data(), list_offsets.size(), list_is_valid.data());
-  for (int8_t value : list_values) {
-    char_vb->UnsafeAppend(value);
-  }
-  for (int32_t value : int_values) {
-    int_vb->UnsafeAppend(value);
-  }
-
-  ASSERT_OK(builder_->Finish(&equal_array));
-
-  ASSERT_OK(builder_->Resize(list_lengths.size()));
-  ASSERT_OK(char_vb->Resize(list_values.size()));
-  ASSERT_OK(int_vb->Resize(int_values.size()));
-
-  // setup an unequal one with the unequal bitmap
-  builder_->Append(unequal_struct_is_valid.size(), unequal_struct_is_valid.data());
-  list_vb->Append(list_offsets.data(), list_offsets.size(), list_is_valid.data());
-  for (int8_t value : list_values) {
-    char_vb->UnsafeAppend(value);
-  }
-  for (int32_t value : int_values) {
-    int_vb->UnsafeAppend(value);
-  }
-
-  ASSERT_OK(builder_->Finish(&unequal_bitmap_array));
-
-  ASSERT_OK(builder_->Resize(list_lengths.size()));
-  ASSERT_OK(char_vb->Resize(list_values.size()));
-  ASSERT_OK(int_vb->Resize(int_values.size()));
-
-  // setup an unequal one with unequal offsets
-  builder_->Append(struct_is_valid.size(), struct_is_valid.data());
-  list_vb->Append(unequal_list_offsets.data(), unequal_list_offsets.size(),
-      unequal_list_is_valid.data());
-  for (int8_t value : list_values) {
-    char_vb->UnsafeAppend(value);
-  }
-  for (int32_t value : int_values) {
-    int_vb->UnsafeAppend(value);
-  }
-
-  ASSERT_OK(builder_->Finish(&unequal_offsets_array));
-
-  ASSERT_OK(builder_->Resize(list_lengths.size()));
-  ASSERT_OK(char_vb->Resize(list_values.size()));
-  ASSERT_OK(int_vb->Resize(int_values.size()));
-
-  // setup anunequal one with unequal values
-  builder_->Append(struct_is_valid.size(), struct_is_valid.data());
-  list_vb->Append(list_offsets.data(), list_offsets.size(), list_is_valid.data());
-  for (int8_t value : unequal_list_values) {
-    char_vb->UnsafeAppend(value);
-  }
-  for (int32_t value : unequal_int_values) {
-    int_vb->UnsafeAppend(value);
-  }
-
-  ASSERT_OK(builder_->Finish(&unequal_values_array));
-
-  // Test array equality
-  EXPECT_TRUE(array->Equals(array));
-  EXPECT_TRUE(array->Equals(equal_array));
-  EXPECT_TRUE(equal_array->Equals(array));
-  EXPECT_FALSE(equal_array->Equals(unequal_bitmap_array));
-  EXPECT_FALSE(unequal_bitmap_array->Equals(equal_array));
-  EXPECT_FALSE(unequal_bitmap_array->Equals(unequal_values_array));
-  EXPECT_FALSE(unequal_values_array->Equals(unequal_bitmap_array));
-  EXPECT_FALSE(unequal_bitmap_array->Equals(unequal_offsets_array));
-  EXPECT_FALSE(unequal_offsets_array->Equals(unequal_bitmap_array));
-
-  // Test range equality
-  EXPECT_TRUE(array->RangeEquals(0, 4, 0, equal_array));
-  EXPECT_TRUE(array->RangeEquals(3, 4, 3, unequal_bitmap_array));
-  EXPECT_TRUE(array->RangeEquals(0, 1, 0, unequal_offsets_array));
-  EXPECT_FALSE(array->RangeEquals(0, 2, 0, unequal_offsets_array));
-  EXPECT_FALSE(array->RangeEquals(1, 2, 1, unequal_offsets_array));
-  EXPECT_FALSE(array->RangeEquals(0, 1, 0, unequal_values_array));
-  EXPECT_TRUE(array->RangeEquals(1, 3, 1, unequal_values_array));
-  EXPECT_FALSE(array->RangeEquals(3, 4, 3, unequal_values_array));
-}
-
-TEST_F(TestStructBuilder, TestZeroLength) {
-  // All buffers are null
-  Done();
-  ASSERT_OK(result_->Validate());
-}
-
-}  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/types/struct.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/struct.cc b/cpp/src/arrow/types/struct.cc
deleted file mode 100644
index 0e0db23..0000000
--- a/cpp/src/arrow/types/struct.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include "arrow/types/struct.h"
-
-#include <sstream>
-
-namespace arrow {
-
-bool StructArray::Equals(const std::shared_ptr<Array>& arr) const {
-  if (this == arr.get()) { return true; }
-  if (!arr) { return false; }
-  if (this->type_enum() != arr->type_enum()) { return false; }
-  if (null_count_ != arr->null_count()) { return false; }
-  return RangeEquals(0, length_, 0, arr);
-}
-
-bool StructArray::RangeEquals(int32_t start_idx, int32_t end_idx, int32_t other_start_idx,
-    const std::shared_ptr<Array>& arr) const {
-  if (this == arr.get()) { return true; }
-  if (!arr) { return false; }
-  if (Type::STRUCT != arr->type_enum()) { return false; }
-  const auto other = static_cast<StructArray*>(arr.get());
-
-  bool equal_fields = true;
-  for (int32_t i = start_idx, o_i = other_start_idx; i < end_idx; ++i, ++o_i) {
-    if (IsNull(i) != arr->IsNull(o_i)) { return false; }
-    if (IsNull(i)) continue;
-    for (size_t j = 0; j < field_arrays_.size(); ++j) {
-      // TODO: really we should be comparing stretches of non-null data rather
-      // than looking at one value at a time.
-      equal_fields = field(j)->RangeEquals(i, i + 1, o_i, other->field(j));
-      if (!equal_fields) { return false; }
-    }
-  }
-
-  return true;
-}
-
-Status StructArray::Validate() const {
-  if (length_ < 0) { return Status::Invalid("Length was negative"); }
-
-  if (null_count() > length_) {
-    return Status::Invalid("Null count exceeds the length of this struct");
-  }
-
-  if (field_arrays_.size() > 0) {
-    // Validate fields
-    int32_t array_length = field_arrays_[0]->length();
-    size_t idx = 0;
-    for (auto it : field_arrays_) {
-      if (it->length() != array_length) {
-        std::stringstream ss;
-        ss << "Length is not equal from field " << it->type()->ToString()
-           << " at position {" << idx << "}";
-        return Status::Invalid(ss.str());
-      }
-
-      const Status child_valid = it->Validate();
-      if (!child_valid.ok()) {
-        std::stringstream ss;
-        ss << "Child array invalid: " << child_valid.ToString() << " at position {" << idx
-           << "}";
-        return Status::Invalid(ss.str());
-      }
-      ++idx;
-    }
-
-    if (array_length > 0 && array_length != length_) {
-      return Status::Invalid("Struct's length is not equal to its child arrays");
-    }
-  }
-  return Status::OK();
-}
-
-Status StructArray::Accept(ArrayVisitor* visitor) const {
-  return visitor->Visit(*this);
-}
-
-Status StructBuilder::Finish(std::shared_ptr<Array>* out) {
-  std::vector<std::shared_ptr<Array>> fields(field_builders_.size());
-  for (size_t i = 0; i < field_builders_.size(); ++i) {
-    RETURN_NOT_OK(field_builders_[i]->Finish(&fields[i]));
-  }
-
-  *out = std::make_shared<StructArray>(type_, length_, fields, null_count_, null_bitmap_);
-
-  null_bitmap_ = nullptr;
-  capacity_ = length_ = null_count_ = 0;
-
-  return Status::OK();
-}
-
-}  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/types/struct.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/struct.h b/cpp/src/arrow/types/struct.h
deleted file mode 100644
index 1e2bf2d..0000000
--- a/cpp/src/arrow/types/struct.h
+++ /dev/null
@@ -1,116 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#ifndef ARROW_TYPES_STRUCT_H
-#define ARROW_TYPES_STRUCT_H
-
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "arrow/type.h"
-#include "arrow/types/list.h"
-#include "arrow/types/primitive.h"
-#include "arrow/util/visibility.h"
-
-namespace arrow {
-
-class ARROW_EXPORT StructArray : public Array {
- public:
-  using TypeClass = StructType;
-
-  StructArray(const TypePtr& type, int32_t length, std::vector<ArrayPtr>& field_arrays,
-      int32_t null_count = 0, std::shared_ptr<Buffer> null_bitmap = nullptr)
-      : Array(type, length, null_count, null_bitmap) {
-    type_ = type;
-    field_arrays_ = field_arrays;
-  }
-
-  Status Validate() const override;
-
-  virtual ~StructArray() {}
-
-  // Return a shared pointer in case the requestor desires to share ownership
-  // with this array.
-  std::shared_ptr<Array> field(int32_t pos) const {
-    DCHECK_GT(field_arrays_.size(), 0);
-    return field_arrays_[pos];
-  }
-  const std::vector<ArrayPtr>& fields() const { return field_arrays_; }
-
-  bool EqualsExact(const StructArray& other) const;
-  bool Equals(const std::shared_ptr<Array>& arr) const override;
-  bool RangeEquals(int32_t start_idx, int32_t end_idx, int32_t other_start_idx,
-      const std::shared_ptr<Array>& arr) const override;
-
-  Status Accept(ArrayVisitor* visitor) const override;
-
- protected:
-  // The child arrays corresponding to each field of the struct data type.
-  std::vector<ArrayPtr> field_arrays_;
-};
-
-// ---------------------------------------------------------------------------------
-// StructArray builder
-// Append, Resize and Reserve methods are acting on StructBuilder.
-// Please make sure all these methods of all child-builders' are consistently
-// called to maintain data-structure consistency.
-class ARROW_EXPORT StructBuilder : public ArrayBuilder {
- public:
-  StructBuilder(MemoryPool* pool, const std::shared_ptr<DataType>& type,
-      const std::vector<std::shared_ptr<ArrayBuilder>>& field_builders)
-      : ArrayBuilder(pool, type) {
-    field_builders_ = field_builders;
-  }
-
-  Status Finish(std::shared_ptr<Array>* out) override;
-
-  // Null bitmap is of equal length to every child field, and any zero byte
-  // will be considered as a null for that field, but users must using app-
-  // end methods or advance methods of the child builders' independently to
-  // insert data.
-  Status Append(int32_t length, const uint8_t* valid_bytes) {
-    RETURN_NOT_OK(Reserve(length));
-    UnsafeAppendToBitmap(valid_bytes, length);
-    return Status::OK();
-  }
-
-  // Append an element to the Struct. All child-builders' Append method must
-  // be called independently to maintain data-structure consistency.
-  Status Append(bool is_valid = true) {
-    RETURN_NOT_OK(Reserve(1));
-    UnsafeAppendToBitmap(is_valid);
-    return Status::OK();
-  }
-
-  Status AppendNull() { return Append(false); }
-
-  std::shared_ptr<ArrayBuilder> field_builder(int pos) const {
-    DCHECK_GT(field_builders_.size(), 0);
-    return field_builders_[pos];
-  }
-  const std::vector<std::shared_ptr<ArrayBuilder>>& field_builders() const {
-    return field_builders_;
-  }
-
- protected:
-  std::vector<std::shared_ptr<ArrayBuilder>> field_builders_;
-};
-
-}  // namespace arrow
-
-#endif  // ARROW_TYPES_STRUCT_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/types/test-common.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/test-common.h b/cpp/src/arrow/types/test-common.h
deleted file mode 100644
index 6e6ab85..0000000
--- a/cpp/src/arrow/types/test-common.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#ifndef ARROW_TYPES_TEST_COMMON_H
-#define ARROW_TYPES_TEST_COMMON_H
-
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-
-#include "arrow/array.h"
-#include "arrow/builder.h"
-#include "arrow/test-util.h"
-#include "arrow/type.h"
-#include "arrow/util/memory-pool.h"
-
-namespace arrow {
-
-using std::unique_ptr;
-
-class TestBuilder : public ::testing::Test {
- public:
-  void SetUp() {
-    pool_ = default_memory_pool();
-    type_ = TypePtr(new UInt8Type());
-    builder_.reset(new UInt8Builder(pool_, type_));
-    builder_nn_.reset(new UInt8Builder(pool_, type_));
-  }
-
- protected:
-  MemoryPool* pool_;
-
-  TypePtr type_;
-  unique_ptr<ArrayBuilder> builder_;
-  unique_ptr<ArrayBuilder> builder_nn_;
-};
-
-template <class T, class Builder>
-Status MakeArray(const std::vector<uint8_t>& valid_bytes, const std::vector<T>& values,
-    int size, Builder* builder, ArrayPtr* out) {
-  // Append the first 1000
-  for (int i = 0; i < size; ++i) {
-    if (valid_bytes[i] > 0) {
-      RETURN_NOT_OK(builder->Append(values[i]));
-    } else {
-      RETURN_NOT_OK(builder->AppendNull());
-    }
-  }
-  return builder->Finish(out);
-}
-
-}  // namespace arrow
-
-#endif  // ARROW_TYPES_TEST_COMMON_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/types/union.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/union.cc b/cpp/src/arrow/types/union.cc
deleted file mode 100644
index cc2934b..0000000
--- a/cpp/src/arrow/types/union.cc
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include "arrow/types/union.h"
-
-#include <cstdlib>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "arrow/type.h"
-
-namespace arrow {}  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/types/union.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/union.h b/cpp/src/arrow/types/union.h
deleted file mode 100644
index 44f39cc..0000000
--- a/cpp/src/arrow/types/union.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#ifndef ARROW_TYPES_UNION_H
-#define ARROW_TYPES_UNION_H
-
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "arrow/array.h"
-#include "arrow/type.h"
-
-namespace arrow {
-
-class Buffer;
-
-class UnionArray : public Array {
- protected:
-  // The data are types encoded as int16
-  Buffer* types_;
-  std::vector<std::shared_ptr<Array>> children_;
-};
-
-class DenseUnionArray : public UnionArray {
- protected:
-  Buffer* offset_buf_;
-};
-
-class SparseUnionArray : public UnionArray {};
-
-}  // namespace arrow
-
-#endif  // ARROW_TYPES_UNION_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/util/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/util/CMakeLists.txt b/cpp/src/arrow/util/CMakeLists.txt
index 6e19730..8d9afcc 100644
--- a/cpp/src/arrow/util/CMakeLists.txt
+++ b/cpp/src/arrow/util/CMakeLists.txt
@@ -22,12 +22,9 @@
 # Headers: top level
 install(FILES
   bit-util.h
-  buffer.h
   logging.h
   macros.h
-  memory-pool.h
   random.h
-  status.h
   visibility.h
   DESTINATION include/arrow/util)
 
@@ -72,6 +69,3 @@ if (ARROW_BUILD_BENCHMARKS)
 endif()
 
 ADD_ARROW_TEST(bit-util-test)
-ADD_ARROW_TEST(buffer-test)
-ADD_ARROW_TEST(memory-pool-test)
-ADD_ARROW_TEST(status-test)

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/util/bit-util.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/util/bit-util.cc b/cpp/src/arrow/util/bit-util.cc
index 7e1cb18..9c82407 100644
--- a/cpp/src/arrow/util/bit-util.cc
+++ b/cpp/src/arrow/util/bit-util.cc
@@ -18,9 +18,9 @@
 #include <cstring>
 #include <vector>
 
+#include "arrow/buffer.h"
+#include "arrow/status.h"
 #include "arrow/util/bit-util.h"
-#include "arrow/util/buffer.h"
-#include "arrow/util/status.h"
 
 namespace arrow {
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/util/buffer-test.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/util/buffer-test.cc b/cpp/src/arrow/util/buffer-test.cc
deleted file mode 100644
index 095b07b..0000000
--- a/cpp/src/arrow/util/buffer-test.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include <cstdint>
-#include <limits>
-#include <string>
-
-#include "gtest/gtest.h"
-
-#include "arrow/test-util.h"
-#include "arrow/util/buffer.h"
-#include "arrow/util/status.h"
-
-using std::string;
-
-namespace arrow {
-
-class TestBuffer : public ::testing::Test {};
-
-TEST_F(TestBuffer, IsMutableFlag) {
-  Buffer buf(nullptr, 0);
-
-  ASSERT_FALSE(buf.is_mutable());
-
-  MutableBuffer mbuf(nullptr, 0);
-  ASSERT_TRUE(mbuf.is_mutable());
-
-  PoolBuffer pbuf;
-  ASSERT_TRUE(pbuf.is_mutable());
-}
-
-TEST_F(TestBuffer, Resize) {
-  PoolBuffer buf;
-
-  ASSERT_EQ(0, buf.size());
-  ASSERT_OK(buf.Resize(100));
-  ASSERT_EQ(100, buf.size());
-  ASSERT_OK(buf.Resize(200));
-  ASSERT_EQ(200, buf.size());
-
-  // Make it smaller, too
-  ASSERT_OK(buf.Resize(50));
-  ASSERT_EQ(50, buf.size());
-}
-
-TEST_F(TestBuffer, ResizeOOM) {
-  // realloc fails, even though there may be no explicit limit
-  PoolBuffer buf;
-  ASSERT_OK(buf.Resize(100));
-  int64_t to_alloc = std::numeric_limits<int64_t>::max();
-  ASSERT_RAISES(OutOfMemory, buf.Resize(to_alloc));
-}
-
-TEST_F(TestBuffer, EqualsWithSameContent) {
-  MemoryPool* pool = default_memory_pool();
-  const int32_t bufferSize = 128 * 1024;
-  uint8_t* rawBuffer1;
-  ASSERT_OK(pool->Allocate(bufferSize, &rawBuffer1));
-  memset(rawBuffer1, 12, bufferSize);
-  uint8_t* rawBuffer2;
-  ASSERT_OK(pool->Allocate(bufferSize, &rawBuffer2));
-  memset(rawBuffer2, 12, bufferSize);
-  uint8_t* rawBuffer3;
-  ASSERT_OK(pool->Allocate(bufferSize, &rawBuffer3));
-  memset(rawBuffer3, 3, bufferSize);
-
-  Buffer buffer1(rawBuffer1, bufferSize);
-  Buffer buffer2(rawBuffer2, bufferSize);
-  Buffer buffer3(rawBuffer3, bufferSize);
-  ASSERT_TRUE(buffer1.Equals(buffer2));
-  ASSERT_FALSE(buffer1.Equals(buffer3));
-
-  pool->Free(rawBuffer1, bufferSize);
-  pool->Free(rawBuffer2, bufferSize);
-  pool->Free(rawBuffer3, bufferSize);
-}
-
-TEST_F(TestBuffer, EqualsWithSameBuffer) {
-  MemoryPool* pool = default_memory_pool();
-  const int32_t bufferSize = 128 * 1024;
-  uint8_t* rawBuffer;
-  ASSERT_OK(pool->Allocate(bufferSize, &rawBuffer));
-  memset(rawBuffer, 111, bufferSize);
-
-  Buffer buffer1(rawBuffer, bufferSize);
-  Buffer buffer2(rawBuffer, bufferSize);
-  ASSERT_TRUE(buffer1.Equals(buffer2));
-
-  const int64_t nbytes = bufferSize / 2;
-  Buffer buffer3(rawBuffer, nbytes);
-  ASSERT_TRUE(buffer1.Equals(buffer3, nbytes));
-  ASSERT_FALSE(buffer1.Equals(buffer3, nbytes + 1));
-
-  pool->Free(rawBuffer, bufferSize);
-}
-
-TEST_F(TestBuffer, Copy) {
-  std::string data_str = "some data to copy";
-
-  auto data = reinterpret_cast<const uint8_t*>(data_str.c_str());
-
-  Buffer buf(data, data_str.size());
-
-  std::shared_ptr<Buffer> out;
-
-  ASSERT_OK(buf.Copy(5, 4, &out));
-
-  Buffer expected(data + 5, 4);
-  ASSERT_TRUE(out->Equals(expected));
-}
-
-TEST_F(TestBuffer, SliceBuffer) {
-  std::string data_str = "some data to slice";
-
-  auto data = reinterpret_cast<const uint8_t*>(data_str.c_str());
-
-  auto buf = std::make_shared<Buffer>(data, data_str.size());
-
-  std::shared_ptr<Buffer> out = SliceBuffer(buf, 5, 4);
-  Buffer expected(data + 5, 4);
-  ASSERT_TRUE(out->Equals(expected));
-
-  ASSERT_EQ(2, buf.use_count());
-}
-
-}  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/util/buffer.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/util/buffer.cc b/cpp/src/arrow/util/buffer.cc
deleted file mode 100644
index a230259..0000000
--- a/cpp/src/arrow/util/buffer.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include "arrow/util/buffer.h"
-
-#include <cstdint>
-#include <limits>
-
-#include "arrow/util/bit-util.h"
-#include "arrow/util/logging.h"
-#include "arrow/util/memory-pool.h"
-#include "arrow/util/status.h"
-
-namespace arrow {
-
-Buffer::Buffer(const std::shared_ptr<Buffer>& parent, int64_t offset, int64_t size) {
-  data_ = parent->data() + offset;
-  size_ = size;
-  parent_ = parent;
-  capacity_ = size;
-}
-
-Buffer::~Buffer() {}
-
-Status Buffer::Copy(
-    int64_t start, int64_t nbytes, MemoryPool* pool, std::shared_ptr<Buffer>* out) const {
-  // Sanity checks
-  DCHECK_LT(start, size_);
-  DCHECK_LE(nbytes, size_ - start);
-
-  auto new_buffer = std::make_shared<PoolBuffer>(pool);
-  RETURN_NOT_OK(new_buffer->Resize(nbytes));
-
-  std::memcpy(new_buffer->mutable_data(), data() + start, nbytes);
-
-  *out = new_buffer;
-  return Status::OK();
-}
-
-Status Buffer::Copy(int64_t start, int64_t nbytes, std::shared_ptr<Buffer>* out) const {
-  return Copy(start, nbytes, default_memory_pool(), out);
-}
-
-std::shared_ptr<Buffer> SliceBuffer(
-    const std::shared_ptr<Buffer>& buffer, int64_t offset, int64_t length) {
-  DCHECK_LT(offset, buffer->size());
-  DCHECK_LE(length, buffer->size() - offset);
-  return std::make_shared<Buffer>(buffer, offset, length);
-}
-
-std::shared_ptr<Buffer> MutableBuffer::GetImmutableView() {
-  return std::make_shared<Buffer>(this->get_shared_ptr(), 0, size());
-}
-
-PoolBuffer::PoolBuffer(MemoryPool* pool) : ResizableBuffer(nullptr, 0) {
-  if (pool == nullptr) { pool = default_memory_pool(); }
-  pool_ = pool;
-}
-
-PoolBuffer::~PoolBuffer() {
-  if (mutable_data_ != nullptr) { pool_->Free(mutable_data_, capacity_); }
-}
-
-Status PoolBuffer::Reserve(int64_t new_capacity) {
-  if (!mutable_data_ || new_capacity > capacity_) {
-    uint8_t* new_data;
-    new_capacity = BitUtil::RoundUpToMultipleOf64(new_capacity);
-    if (mutable_data_) {
-      RETURN_NOT_OK(pool_->Allocate(new_capacity, &new_data));
-      memcpy(new_data, mutable_data_, size_);
-      pool_->Free(mutable_data_, capacity_);
-    } else {
-      RETURN_NOT_OK(pool_->Allocate(new_capacity, &new_data));
-    }
-    mutable_data_ = new_data;
-    data_ = mutable_data_;
-    capacity_ = new_capacity;
-  }
-  return Status::OK();
-}
-
-Status PoolBuffer::Resize(int64_t new_size) {
-  RETURN_NOT_OK(Reserve(new_size));
-  size_ = new_size;
-  return Status::OK();
-}
-
-}  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/util/buffer.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/util/buffer.h b/cpp/src/arrow/util/buffer.h
deleted file mode 100644
index 5c87395..0000000
--- a/cpp/src/arrow/util/buffer.h
+++ /dev/null
@@ -1,232 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#ifndef ARROW_UTIL_BUFFER_H
-#define ARROW_UTIL_BUFFER_H
-
-#include <algorithm>
-#include <cstdint>
-#include <cstring>
-#include <memory>
-
-#include "arrow/util/macros.h"
-#include "arrow/util/status.h"
-#include "arrow/util/visibility.h"
-
-namespace arrow {
-
-class MemoryPool;
-class Status;
-
-// ----------------------------------------------------------------------
-// Buffer classes
-
-// Immutable API for a chunk of bytes which may or may not be owned by the
-// class instance.  Buffers have two related notions of length: size and
-// capacity.  Size is the number of bytes that might have valid data.
-// Capacity is the number of bytes that where allocated for the buffer in
-// total.
-// The following invariant is always true: Size < Capacity
-class ARROW_EXPORT Buffer : public std::enable_shared_from_this<Buffer> {
- public:
-  Buffer(const uint8_t* data, int64_t size)
-      : is_mutable_(false), data_(data), size_(size), capacity_(size) {}
-  virtual ~Buffer();
-
-  // An offset into data that is owned by another buffer, but we want to be
-  // able to retain a valid pointer to it even after other shared_ptr's to the
-  // parent buffer have been destroyed
-  //
-  // This method makes no assertions about alignment or padding of the buffer but
-  // in general we expected buffers to be aligned and padded to 64 bytes.  In the future
-  // we might add utility methods to help determine if a buffer satisfies this contract.
-  Buffer(const std::shared_ptr<Buffer>& parent, int64_t offset, int64_t size);
-
-  std::shared_ptr<Buffer> get_shared_ptr() { return shared_from_this(); }
-
-  bool is_mutable() const { return is_mutable_; }
-
-  // Return true if both buffers are the same size and contain the same bytes
-  // up to the number of compared bytes
-  bool Equals(const Buffer& other, int64_t nbytes) const {
-    return this == &other ||
-           (size_ >= nbytes && other.size_ >= nbytes &&
-               (data_ == other.data_ || !memcmp(data_, other.data_, nbytes)));
-  }
-
-  bool Equals(const Buffer& other) const {
-    return this == &other ||
-           (size_ == other.size_ &&
-               (data_ == other.data_ || !memcmp(data_, other.data_, size_)));
-  }
-
-  // Copy section of buffer into a new Buffer
-  Status Copy(int64_t start, int64_t nbytes, MemoryPool* pool,
-      std::shared_ptr<Buffer>* out) const;
-
-  // Default memory pool
-  Status Copy(int64_t start, int64_t nbytes, std::shared_ptr<Buffer>* out) const;
-
-  int64_t capacity() const { return capacity_; }
-  const uint8_t* data() const { return data_; }
-
-  int64_t size() const { return size_; }
-
-  std::shared_ptr<Buffer> parent() const { return parent_; }
-
- protected:
-  bool is_mutable_;
-  const uint8_t* data_;
-  int64_t size_;
-  int64_t capacity_;
-
-  // nullptr by default, but may be set
-  std::shared_ptr<Buffer> parent_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(Buffer);
-};
-
-// Construct a view on passed buffer at the indicated offset and length. This
-// function cannot fail and does not error checking (except in debug builds)
-ARROW_EXPORT std::shared_ptr<Buffer> SliceBuffer(
-    const std::shared_ptr<Buffer>& buffer, int64_t offset, int64_t length);
-
-// A Buffer whose contents can be mutated. May or may not own its data.
-class ARROW_EXPORT MutableBuffer : public Buffer {
- public:
-  MutableBuffer(uint8_t* data, int64_t size) : Buffer(data, size) {
-    is_mutable_ = true;
-    mutable_data_ = data;
-  }
-
-  uint8_t* mutable_data() { return mutable_data_; }
-
-  // Get a read-only view of this buffer
-  std::shared_ptr<Buffer> GetImmutableView();
-
- protected:
-  MutableBuffer() : Buffer(nullptr, 0), mutable_data_(nullptr) {}
-
-  uint8_t* mutable_data_;
-};
-
-class ARROW_EXPORT ResizableBuffer : public MutableBuffer {
- public:
-  // Change buffer reported size to indicated size, allocating memory if
-  // necessary.  This will ensure that the capacity of the buffer is a multiple
-  // of 64 bytes as defined in Layout.md.
-  virtual Status Resize(int64_t new_size) = 0;
-
-  // Ensure that buffer has enough memory allocated to fit the indicated
-  // capacity (and meets the 64 byte padding requirement in Layout.md).
-  // It does not change buffer's reported size.
-  virtual Status Reserve(int64_t new_capacity) = 0;
-
- protected:
-  ResizableBuffer(uint8_t* data, int64_t size) : MutableBuffer(data, size) {}
-};
-
-// A Buffer whose lifetime is tied to a particular MemoryPool
-class ARROW_EXPORT PoolBuffer : public ResizableBuffer {
- public:
-  explicit PoolBuffer(MemoryPool* pool = nullptr);
-  virtual ~PoolBuffer();
-
-  Status Resize(int64_t new_size) override;
-  Status Reserve(int64_t new_capacity) override;
-
- private:
-  MemoryPool* pool_;
-};
-
-class ARROW_EXPORT BufferBuilder {
- public:
-  explicit BufferBuilder(MemoryPool* pool)
-      : pool_(pool), data_(nullptr), capacity_(0), size_(0) {}
-
-  // Resizes the buffer to the nearest multiple of 64 bytes per Layout.md
-  Status Resize(int32_t elements) {
-    if (capacity_ == 0) { buffer_ = std::make_shared<PoolBuffer>(pool_); }
-    RETURN_NOT_OK(buffer_->Resize(elements));
-    capacity_ = buffer_->capacity();
-    data_ = buffer_->mutable_data();
-    return Status::OK();
-  }
-
-  Status Append(const uint8_t* data, int length) {
-    if (capacity_ < length + size_) { RETURN_NOT_OK(Resize(length + size_)); }
-    UnsafeAppend(data, length);
-    return Status::OK();
-  }
-
-  template <typename T>
-  Status Append(T arithmetic_value) {
-    static_assert(std::is_arithmetic<T>::value,
-        "Convenience buffer append only supports arithmetic types");
-    return Append(reinterpret_cast<uint8_t*>(&arithmetic_value), sizeof(T));
-  }
-
-  template <typename T>
-  Status Append(const T* arithmetic_values, int num_elements) {
-    static_assert(std::is_arithmetic<T>::value,
-        "Convenience buffer append only supports arithmetic types");
-    return Append(
-        reinterpret_cast<const uint8_t*>(arithmetic_values), num_elements * sizeof(T));
-  }
-
-  // Unsafe methods don't check existing size
-  void UnsafeAppend(const uint8_t* data, int length) {
-    memcpy(data_ + size_, data, length);
-    size_ += length;
-  }
-
-  template <typename T>
-  void UnsafeAppend(T arithmetic_value) {
-    static_assert(std::is_arithmetic<T>::value,
-        "Convenience buffer append only supports arithmetic types");
-    UnsafeAppend(reinterpret_cast<uint8_t*>(&arithmetic_value), sizeof(T));
-  }
-
-  template <typename T>
-  void UnsafeAppend(const T* arithmetic_values, int num_elements) {
-    static_assert(std::is_arithmetic<T>::value,
-        "Convenience buffer append only supports arithmetic types");
-    UnsafeAppend(
-        reinterpret_cast<const uint8_t*>(arithmetic_values), num_elements * sizeof(T));
-  }
-
-  std::shared_ptr<Buffer> Finish() {
-    auto result = buffer_;
-    buffer_ = nullptr;
-    capacity_ = size_ = 0;
-    return result;
-  }
-  int capacity() { return capacity_; }
-  int length() { return size_; }
-
- private:
-  std::shared_ptr<PoolBuffer> buffer_;
-  MemoryPool* pool_;
-  uint8_t* data_;
-  int64_t capacity_;
-  int64_t size_;
-};
-
-}  // namespace arrow
-
-#endif  // ARROW_UTIL_BUFFER_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/util/memory-pool-test.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/util/memory-pool-test.cc b/cpp/src/arrow/util/memory-pool-test.cc
deleted file mode 100644
index 5d60376..0000000
--- a/cpp/src/arrow/util/memory-pool-test.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include <cstdint>
-#include <limits>
-
-#include "gtest/gtest.h"
-
-#include "arrow/test-util.h"
-#include "arrow/util/memory-pool.h"
-#include "arrow/util/status.h"
-
-namespace arrow {
-
-TEST(DefaultMemoryPool, MemoryTracking) {
-  MemoryPool* pool = default_memory_pool();
-
-  uint8_t* data;
-  ASSERT_OK(pool->Allocate(100, &data));
-  EXPECT_EQ(static_cast<uint64_t>(0), reinterpret_cast<uint64_t>(data) % 64);
-  ASSERT_EQ(100, pool->bytes_allocated());
-
-  pool->Free(data, 100);
-  ASSERT_EQ(0, pool->bytes_allocated());
-}
-
-TEST(DefaultMemoryPool, OOM) {
-  MemoryPool* pool = default_memory_pool();
-
-  uint8_t* data;
-  int64_t to_alloc = std::numeric_limits<int64_t>::max();
-  ASSERT_RAISES(OutOfMemory, pool->Allocate(to_alloc, &data));
-}
-
-// Death tests and valgrind are known to not play well 100% of the time. See
-// googletest documentation
-#ifndef ARROW_VALGRIND
-
-TEST(DefaultMemoryPoolDeathTest, FreeLargeMemory) {
-  MemoryPool* pool = default_memory_pool();
-
-  uint8_t* data;
-  ASSERT_OK(pool->Allocate(100, &data));
-
-#ifndef NDEBUG
-  EXPECT_EXIT(pool->Free(data, 120), ::testing::ExitedWithCode(1),
-      ".*Check failed: \\(bytes_allocated_\\) >= \\(size\\)");
-#endif
-
-  pool->Free(data, 100);
-}
-
-#endif  // ARROW_VALGRIND
-
-}  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/util/memory-pool.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/util/memory-pool.cc b/cpp/src/arrow/util/memory-pool.cc
deleted file mode 100644
index 9aa7066..0000000
--- a/cpp/src/arrow/util/memory-pool.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include "arrow/util/memory-pool.h"
-
-#include <cstdlib>
-#include <mutex>
-#include <sstream>
-#include <stdlib.h>
-
-#include "arrow/util/logging.h"
-#include "arrow/util/status.h"
-
-namespace arrow {
-
-namespace {
-// Allocate memory according to the alignment requirements for Arrow
-// (as of May 2016 64 bytes)
-Status AllocateAligned(int64_t size, uint8_t** out) {
-  // TODO(emkornfield) find something compatible with windows
-  constexpr size_t kAlignment = 64;
-#ifdef _MSC_VER
-  // Special code path for MSVC
-  *out = reinterpret_cast<uint8_t*>(_aligned_malloc(size, kAlignment));
-  if (!*out) {
-    std::stringstream ss;
-    ss << "malloc of size " << size << " failed";
-    return Status::OutOfMemory(ss.str());
-  }
-#else
-  const int result = posix_memalign(reinterpret_cast<void**>(out), kAlignment, size);
-  if (result == ENOMEM) {
-    std::stringstream ss;
-    ss << "malloc of size " << size << " failed";
-    return Status::OutOfMemory(ss.str());
-  }
-
-  if (result == EINVAL) {
-    std::stringstream ss;
-    ss << "invalid alignment parameter: " << kAlignment;
-    return Status::Invalid(ss.str());
-  }
-#endif
-  return Status::OK();
-}
-}  // namespace
-
-MemoryPool::~MemoryPool() {}
-
-class InternalMemoryPool : public MemoryPool {
- public:
-  InternalMemoryPool() : bytes_allocated_(0) {}
-  virtual ~InternalMemoryPool();
-
-  Status Allocate(int64_t size, uint8_t** out) override;
-
-  void Free(uint8_t* buffer, int64_t size) override;
-
-  int64_t bytes_allocated() const override;
-
- private:
-  mutable std::mutex pool_lock_;
-  int64_t bytes_allocated_;
-};
-
-Status InternalMemoryPool::Allocate(int64_t size, uint8_t** out) {
-  std::lock_guard<std::mutex> guard(pool_lock_);
-  RETURN_NOT_OK(AllocateAligned(size, out));
-  bytes_allocated_ += size;
-
-  return Status::OK();
-}
-
-int64_t InternalMemoryPool::bytes_allocated() const {
-  std::lock_guard<std::mutex> guard(pool_lock_);
-  return bytes_allocated_;
-}
-
-void InternalMemoryPool::Free(uint8_t* buffer, int64_t size) {
-  std::lock_guard<std::mutex> guard(pool_lock_);
-  DCHECK_GE(bytes_allocated_, size);
-#ifdef _MSC_VER
-  _aligned_free(buffer);
-#else
-  std::free(buffer);
-#endif
-  bytes_allocated_ -= size;
-}
-
-InternalMemoryPool::~InternalMemoryPool() {}
-
-MemoryPool* default_memory_pool() {
-  static InternalMemoryPool default_memory_pool_;
-  return &default_memory_pool_;
-}
-
-}  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/util/memory-pool.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/util/memory-pool.h b/cpp/src/arrow/util/memory-pool.h
deleted file mode 100644
index 4c1d699..0000000
--- a/cpp/src/arrow/util/memory-pool.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#ifndef ARROW_UTIL_MEMORY_POOL_H
-#define ARROW_UTIL_MEMORY_POOL_H
-
-#include <cstdint>
-
-#include "arrow/util/visibility.h"
-
-namespace arrow {
-
-class Status;
-
-class ARROW_EXPORT MemoryPool {
- public:
-  virtual ~MemoryPool();
-
-  virtual Status Allocate(int64_t size, uint8_t** out) = 0;
-  virtual void Free(uint8_t* buffer, int64_t size) = 0;
-
-  virtual int64_t bytes_allocated() const = 0;
-};
-
-ARROW_EXPORT MemoryPool* default_memory_pool();
-
-}  // namespace arrow
-
-#endif  // ARROW_UTIL_MEMORY_POOL_H

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/util/status-test.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/util/status-test.cc b/cpp/src/arrow/util/status-test.cc
deleted file mode 100644
index e0ff20f..0000000
--- a/cpp/src/arrow/util/status-test.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include "gtest/gtest.h"
-
-#include "arrow/test-util.h"
-#include "arrow/util/status.h"
-
-namespace arrow {
-
-TEST(StatusTest, TestCodeAndMessage) {
-  Status ok = Status::OK();
-  ASSERT_EQ(StatusCode::OK, ok.code());
-  Status file_error = Status::IOError("file error");
-  ASSERT_EQ(StatusCode::IOError, file_error.code());
-  ASSERT_EQ("file error", file_error.message());
-}
-
-TEST(StatusTest, TestToString) {
-  Status file_error = Status::IOError("file error");
-  ASSERT_EQ("IOError: file error", file_error.ToString());
-}
-
-}  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/util/status.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/util/status.cc b/cpp/src/arrow/util/status.cc
deleted file mode 100644
index 08e9ae3..0000000
--- a/cpp/src/arrow/util/status.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
-//
-// A Status encapsulates the result of an operation.  It may indicate success,
-// or it may indicate an error with an associated error message.
-//
-// Multiple threads can invoke const methods on a Status without
-// external synchronization, but if any of the threads may call a
-// non-const method, all threads accessing the same Status must use
-// external synchronization.
-
-#include "arrow/util/status.h"
-
-#include <assert.h>
-
-namespace arrow {
-
-Status::Status(StatusCode code, const std::string& msg, int16_t posix_code) {
-  assert(code != StatusCode::OK);
-  const uint32_t size = msg.size();
-  char* result = new char[size + 7];
-  memcpy(result, &size, sizeof(size));
-  result[4] = static_cast<char>(code);
-  memcpy(result + 5, &posix_code, sizeof(posix_code));
-  memcpy(result + 7, msg.c_str(), msg.size());
-  state_ = result;
-}
-
-const char* Status::CopyState(const char* state) {
-  uint32_t size;
-  memcpy(&size, state, sizeof(size));
-  char* result = new char[size + 7];
-  memcpy(result, state, size + 7);
-  return result;
-}
-
-std::string Status::CodeAsString() const {
-  if (state_ == NULL) { return "OK"; }
-
-  const char* type;
-  switch (code()) {
-    case StatusCode::OK:
-      type = "OK";
-      break;
-    case StatusCode::OutOfMemory:
-      type = "Out of memory";
-      break;
-    case StatusCode::KeyError:
-      type = "Key error";
-      break;
-    case StatusCode::TypeError:
-      type = "Type error";
-      break;
-    case StatusCode::Invalid:
-      type = "Invalid";
-      break;
-    case StatusCode::IOError:
-      type = "IOError";
-      break;
-    case StatusCode::UnknownError:
-      type = "Unknown error";
-      break;
-    case StatusCode::NotImplemented:
-      type = "NotImplemented";
-      break;
-    default:
-      type = "Unknown";
-      break;
-  }
-  return std::string(type);
-}
-
-std::string Status::ToString() const {
-  std::string result(CodeAsString());
-  if (state_ == NULL) { return result; }
-
-  result.append(": ");
-
-  uint32_t length;
-  memcpy(&length, state_, sizeof(length));
-  result.append(reinterpret_cast<const char*>(state_ + 7), length);
-  return result;
-}
-
-}  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/cpp/src/arrow/util/status.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/util/status.h b/cpp/src/arrow/util/status.h
deleted file mode 100644
index 05f5b74..0000000
--- a/cpp/src/arrow/util/status.h
+++ /dev/null
@@ -1,192 +0,0 @@
-// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
-//
-// A Status encapsulates the result of an operation.  It may indicate success,
-// or it may indicate an error with an associated error message.
-//
-// Multiple threads can invoke const methods on a Status without
-// external synchronization, but if any of the threads may call a
-// non-const method, all threads accessing the same Status must use
-// external synchronization.
-
-// Adapted from Kudu github.com/cloudera/kudu
-
-#ifndef ARROW_STATUS_H_
-#define ARROW_STATUS_H_
-
-#include <cstdint>
-#include <cstring>
-#include <string>
-
-#include "arrow/util/visibility.h"
-
-// Return the given status if it is not OK.
-#define ARROW_RETURN_NOT_OK(s)   \
-  do {                           \
-    ::arrow::Status _s = (s);    \
-    if (!_s.ok()) { return _s; } \
-  } while (0);
-
-// Return the given status if it is not OK, but first clone it and
-// prepend the given message.
-#define ARROW_RETURN_NOT_OK_PREPEND(s, msg)                               \
-  do {                                                                    \
-    ::arrow::Status _s = (s);                                             \
-    if (::gutil::PREDICT_FALSE(!_s.ok())) return _s.CloneAndPrepend(msg); \
-  } while (0);
-
-// Return 'to_return' if 'to_call' returns a bad status.
-// The substitution for 'to_return' may reference the variable
-// 's' for the bad status.
-#define ARROW_RETURN_NOT_OK_RET(to_call, to_return)          \
-  do {                                                       \
-    ::arrow::Status s = (to_call);                           \
-    if (::gutil::PREDICT_FALSE(!s.ok())) return (to_return); \
-  } while (0);
-
-// If 'to_call' returns a bad status, CHECK immediately with a logged message
-// of 'msg' followed by the status.
-#define ARROW_CHECK_OK_PREPEND(to_call, msg)                \
-  do {                                                      \
-    ::arrow::Status _s = (to_call);                         \
-    ARROW_CHECK(_s.ok()) << (msg) << ": " << _s.ToString(); \
-  } while (0);
-
-// If the status is bad, CHECK immediately, appending the status to the
-// logged message.
-#define ARROW_CHECK_OK(s) ARROW_CHECK_OK_PREPEND(s, "Bad status")
-
-namespace arrow {
-
-#define RETURN_NOT_OK(s)         \
-  do {                           \
-    Status _s = (s);             \
-    if (!_s.ok()) { return _s; } \
-  } while (0);
-
-#define RETURN_NOT_OK_ELSE(s, else_) \
-  do {                               \
-    Status _s = (s);                 \
-    if (!_s.ok()) {                  \
-      else_;                         \
-      return _s;                     \
-    }                                \
-  } while (0);
-
-enum class StatusCode : char {
-  OK = 0,
-  OutOfMemory = 1,
-  KeyError = 2,
-  TypeError = 3,
-  Invalid = 4,
-  IOError = 5,
-  UnknownError = 9,
-  NotImplemented = 10,
-};
-
-class ARROW_EXPORT Status {
- public:
-  // Create a success status.
-  Status() : state_(NULL) {}
-  ~Status() { delete[] state_; }
-
-  // Copy the specified status.
-  Status(const Status& s);
-  void operator=(const Status& s);
-
-  // Return a success status.
-  static Status OK() { return Status(); }
-
-  // Return error status of an appropriate type.
-  static Status OutOfMemory(const std::string& msg, int16_t posix_code = -1) {
-    return Status(StatusCode::OutOfMemory, msg, posix_code);
-  }
-
-  static Status KeyError(const std::string& msg) {
-    return Status(StatusCode::KeyError, msg, -1);
-  }
-
-  static Status TypeError(const std::string& msg) {
-    return Status(StatusCode::TypeError, msg, -1);
-  }
-
-  static Status UnknownError(const std::string& msg) {
-    return Status(StatusCode::UnknownError, msg, -1);
-  }
-
-  static Status NotImplemented(const std::string& msg) {
-    return Status(StatusCode::NotImplemented, msg, -1);
-  }
-
-  static Status Invalid(const std::string& msg) {
-    return Status(StatusCode::Invalid, msg, -1);
-  }
-
-  static Status IOError(const std::string& msg) {
-    return Status(StatusCode::IOError, msg, -1);
-  }
-
-  // Returns true iff the status indicates success.
-  bool ok() const { return (state_ == NULL); }
-
-  bool IsOutOfMemory() const { return code() == StatusCode::OutOfMemory; }
-  bool IsKeyError() const { return code() == StatusCode::KeyError; }
-  bool IsInvalid() const { return code() == StatusCode::Invalid; }
-  bool IsIOError() const { return code() == StatusCode::IOError; }
-
-  bool IsUnknownError() const { return code() == StatusCode::UnknownError; }
-  bool IsNotImplemented() const { return code() == StatusCode::NotImplemented; }
-
-  // Return a string representation of this status suitable for printing.
-  // Returns the string "OK" for success.
-  std::string ToString() const;
-
-  // Return a string representation of the status code, without the message
-  // text or posix code information.
-  std::string CodeAsString() const;
-
-  // Get the POSIX code associated with this Status, or -1 if there is none.
-  int16_t posix_code() const;
-
-  StatusCode code() const {
-    return ((state_ == NULL) ? StatusCode::OK : static_cast<StatusCode>(state_[4]));
-  }
-
-  std::string message() const {
-    uint32_t length;
-    memcpy(&length, state_, sizeof(length));
-    std::string msg;
-    msg.append((state_ + 7), length);
-    return msg;
-  }
-
- private:
-  // OK status has a NULL state_.  Otherwise, state_ is a new[] array
-  // of the following form:
-  //    state_[0..3] == length of message
-  //    state_[4]    == code
-  //    state_[5..6] == posix_code
-  //    state_[7..]  == message
-  const char* state_;
-
-  Status(StatusCode code, const std::string& msg, int16_t posix_code);
-  static const char* CopyState(const char* s);
-};
-
-inline Status::Status(const Status& s) {
-  state_ = (s.state_ == NULL) ? NULL : CopyState(s.state_);
-}
-
-inline void Status::operator=(const Status& s) {
-  // The following condition catches both aliasing (when this == &s),
-  // and the common case where both s and *this are ok.
-  if (state_ != s.state_) {
-    delete[] state_;
-    state_ = (s.state_ == NULL) ? NULL : CopyState(s.state_);
-  }
-}
-
-}  // namespace arrow
-
-#endif  // ARROW_STATUS_H_

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/python/src/pyarrow/adapters/builtin.cc
----------------------------------------------------------------------
diff --git a/python/src/pyarrow/adapters/builtin.cc b/python/src/pyarrow/adapters/builtin.cc
index c034fbd..ac2f533 100644
--- a/python/src/pyarrow/adapters/builtin.cc
+++ b/python/src/pyarrow/adapters/builtin.cc
@@ -21,7 +21,7 @@
 #include "pyarrow/adapters/builtin.h"
 
 #include "arrow/api.h"
-#include "arrow/util/status.h"
+#include "arrow/status.h"
 
 #include "pyarrow/helpers.h"
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/python/src/pyarrow/adapters/pandas.cc
----------------------------------------------------------------------
diff --git a/python/src/pyarrow/adapters/pandas.cc b/python/src/pyarrow/adapters/pandas.cc
index adb27e8..64b7086 100644
--- a/python/src/pyarrow/adapters/pandas.cc
+++ b/python/src/pyarrow/adapters/pandas.cc
@@ -31,7 +31,7 @@
 
 #include "arrow/api.h"
 #include "arrow/util/bit-util.h"
-#include "arrow/util/status.h"
+#include "arrow/status.h"
 
 #include "pyarrow/common.h"
 #include "pyarrow/config.h"

http://git-wip-us.apache.org/repos/asf/arrow/blob/2c10d7cc/python/src/pyarrow/common.cc
----------------------------------------------------------------------
diff --git a/python/src/pyarrow/common.cc b/python/src/pyarrow/common.cc
index fa875f2..fb4d349 100644
--- a/python/src/pyarrow/common.cc
+++ b/python/src/pyarrow/common.cc
@@ -21,8 +21,8 @@
 #include <mutex>
 #include <sstream>
 
-#include "arrow/util/memory-pool.h"
-#include "arrow/util/status.h"
+#include "arrow/memory_pool.h"
+#include "arrow/status.h"
 
 using arrow::Status;
 


Mime
View raw message