diff --git a/cpp/src/arrow/array-test.cc b/cpp/src/arrow/array-test.cc index 65e0e26fd38e7..16afb9bef348c 100644 --- a/cpp/src/arrow/array-test.cc +++ b/cpp/src/arrow/array-test.cc @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -29,6 +30,7 @@ #include "arrow/types/primitive.h" #include "arrow/util/buffer.h" #include "arrow/util/memory-pool.h" +#include "arrow/util/status.h" using std::string; using std::vector; diff --git a/cpp/src/arrow/array.h b/cpp/src/arrow/array.h index c95450d12a419..0eaa28d528e37 100644 --- a/cpp/src/arrow/array.h +++ b/cpp/src/arrow/array.h @@ -19,7 +19,6 @@ #define ARROW_ARRAY_H #include -#include #include #include "arrow/type.h" diff --git a/cpp/src/arrow/builder.h b/cpp/src/arrow/builder.h index 3a16b7ff16810..456bb04ae090a 100644 --- a/cpp/src/arrow/builder.h +++ b/cpp/src/arrow/builder.h @@ -23,7 +23,6 @@ #include #include "arrow/type.h" -#include "arrow/util/buffer.h" #include "arrow/util/macros.h" #include "arrow/util/status.h" @@ -31,6 +30,7 @@ namespace arrow { class Array; class MemoryPool; +class PoolBuffer; static constexpr int64_t MIN_BUILDER_CAPACITY = 1 << 8; diff --git a/cpp/src/arrow/types/primitive-test.cc b/cpp/src/arrow/types/primitive-test.cc index 80f191b321782..3484294a39f9a 100644 --- a/cpp/src/arrow/types/primitive-test.cc +++ b/cpp/src/arrow/types/primitive-test.cc @@ -18,7 +18,6 @@ #include #include -#include #include #include #include diff --git a/cpp/src/arrow/types/primitive.h b/cpp/src/arrow/types/primitive.h index e270c810c6950..c5ae0f78a991b 100644 --- a/cpp/src/arrow/types/primitive.h +++ b/cpp/src/arrow/types/primitive.h @@ -20,6 +20,7 @@ #include #include +#include #include #include "arrow/array.h" diff --git a/cpp/src/arrow/types/string-test.cc b/cpp/src/arrow/types/string-test.cc index 0788dabfdee10..a2d87ead59c59 100644 --- a/cpp/src/arrow/types/string-test.cc +++ b/cpp/src/arrow/types/string-test.cc @@ -31,12 +31,9 @@ #include "arrow/types/test-common.h" #include "arrow/util/status.h" -using std::string; -using std::unique_ptr; -using std::vector; - namespace arrow { +class Buffer; TEST(TypesTest, TestCharType) { CharType t1(5); @@ -45,7 +42,7 @@ TEST(TypesTest, TestCharType) { ASSERT_TRUE(t1.nullable); ASSERT_EQ(t1.size, 5); - ASSERT_EQ(t1.ToString(), string("char(5)")); + ASSERT_EQ(t1.ToString(), std::string("char(5)")); // Test copy constructor CharType t2 = t1; @@ -63,7 +60,7 @@ TEST(TypesTest, TestVarcharType) { ASSERT_EQ(t1.size, 5); ASSERT_EQ(t1.physical_type.size, 6); - ASSERT_EQ(t1.ToString(), string("varchar(5)")); + ASSERT_EQ(t1.ToString(), std::string("varchar(5)")); // Test copy constructor VarcharType t2 = t1; @@ -78,7 +75,7 @@ TEST(TypesTest, TestStringType) { StringType str_nn(false); ASSERT_EQ(str.type, TypeEnum::STRING); - ASSERT_EQ(str.name(), string("string")); + ASSERT_EQ(str.name(), std::string("string")); ASSERT_TRUE(str.nullable); ASSERT_FALSE(str_nn.nullable); } @@ -111,11 +108,11 @@ class TestStringContainer : public ::testing::Test { } protected: - vector offsets_; - vector chars_; - vector nulls_; + std::vector offsets_; + std::vector chars_; + std::vector nulls_; - vector expected_; + std::vector expected_; std::shared_ptr value_buf_; std::shared_ptr offsets_buf_; @@ -188,8 +185,8 @@ class TestStringBuilder : public TestBuilder { protected: TypePtr type_; - unique_ptr builder_; - unique_ptr result_; + std::unique_ptr builder_; + std::unique_ptr result_; }; TEST_F(TestStringBuilder, TestAttrs) { @@ -197,8 +194,8 @@ TEST_F(TestStringBuilder, TestAttrs) { } TEST_F(TestStringBuilder, TestScalarAppend) { - vector strings = {"a", "bb", "", "", "ccc"}; - vector is_null = {0, 0, 0, 1, 0}; + std::vector strings = {"a", "bb", "", "", "ccc"}; + std::vector is_null = {0, 0, 0, 1, 0}; int N = strings.size(); int reps = 1000; diff --git a/cpp/src/arrow/types/string.h b/cpp/src/arrow/types/string.h index c36a51dc077b4..d0690d9a7d2a4 100644 --- a/cpp/src/arrow/types/string.h +++ b/cpp/src/arrow/types/string.h @@ -27,12 +27,13 @@ #include "arrow/type.h" #include "arrow/types/integer.h" #include "arrow/types/list.h" -#include "arrow/util/buffer.h" #include "arrow/util/status.h" namespace arrow { class ArrayBuilder; +class Buffer; +class MemoryPool; struct CharType : public DataType { int size; diff --git a/cpp/src/arrow/types/struct.cc b/cpp/src/arrow/types/struct.cc index b7be5d8245f1d..a245656b516cc 100644 --- a/cpp/src/arrow/types/struct.cc +++ b/cpp/src/arrow/types/struct.cc @@ -17,6 +17,7 @@ #include "arrow/types/struct.h" +#include #include #include #include diff --git a/cpp/src/arrow/types/union.cc b/cpp/src/arrow/types/union.cc index 54f41a7eef6be..db3f81795eae2 100644 --- a/cpp/src/arrow/types/union.cc +++ b/cpp/src/arrow/types/union.cc @@ -17,6 +17,7 @@ #include "arrow/types/union.h" +#include #include #include #include diff --git a/cpp/src/arrow/util/bit-util.h b/cpp/src/arrow/util/bit-util.h index 61dffa30423b1..9ae6127c5ea9c 100644 --- a/cpp/src/arrow/util/bit-util.h +++ b/cpp/src/arrow/util/bit-util.h @@ -22,10 +22,9 @@ #include #include -#include "arrow/util/buffer.h" - namespace arrow { +class Buffer; class Status; namespace util { diff --git a/cpp/src/arrow/util/buffer-test.cc b/cpp/src/arrow/util/buffer-test.cc index 444c371bb1b08..9f1fd91432b4d 100644 --- a/cpp/src/arrow/util/buffer-test.cc +++ b/cpp/src/arrow/util/buffer-test.cc @@ -16,10 +16,8 @@ // under the License. #include -#include #include #include -#include #include #include "arrow/test-util.h" diff --git a/cpp/src/arrow/util/buffer.h b/cpp/src/arrow/util/buffer.h index 71c8061b3ad5e..8704723eb0a89 100644 --- a/cpp/src/arrow/util/buffer.h +++ b/cpp/src/arrow/util/buffer.h @@ -19,7 +19,6 @@ #define ARROW_UTIL_BUFFER_H #include -#include #include #include diff --git a/cpp/src/arrow/util/memory-pool-test.cc b/cpp/src/arrow/util/memory-pool-test.cc index 899ecc31974cd..954b5f951b558 100644 --- a/cpp/src/arrow/util/memory-pool-test.cc +++ b/cpp/src/arrow/util/memory-pool-test.cc @@ -20,12 +20,9 @@ #include #include "arrow/test-util.h" -#include "arrow/util/buffer.h" #include "arrow/util/memory-pool.h" #include "arrow/util/status.h" -using std::string; - namespace arrow { TEST(DefaultMemoryPool, MemoryTracking) { diff --git a/cpp/src/arrow/util/memory-pool.cc b/cpp/src/arrow/util/memory-pool.cc index 178ab7f799877..5820346e5a739 100644 --- a/cpp/src/arrow/util/memory-pool.cc +++ b/cpp/src/arrow/util/memory-pool.cc @@ -19,7 +19,6 @@ #include #include -#include #include #include "arrow/util/status.h" diff --git a/cpp/src/arrow/util/memory-pool.h b/cpp/src/arrow/util/memory-pool.h index 24abfc251fae4..a7cb10dae1703 100644 --- a/cpp/src/arrow/util/memory-pool.h +++ b/cpp/src/arrow/util/memory-pool.h @@ -19,11 +19,9 @@ #define ARROW_UTIL_MEMORY_POOL_H #include -#include namespace arrow { -class Buffer; class Status; class MemoryPool {