2626
2727#include " arrow/parquet/schema.h"
2828
29+ using ParquetType = parquet::Type;
30+ using parquet::LogicalType;
31+ using parquet::Repetition;
32+ using parquet::schema::NodePtr;
33+ using parquet::schema::GroupNode;
34+ using parquet::schema::PrimitiveNode;
35+
2936namespace arrow {
3037
3138namespace parquet {
3239
33- using parquet_cpp::Repetition;
34- using parquet_cpp::schema::NodePtr;
35- using parquet_cpp::schema::GroupNode;
36- using parquet_cpp::schema::PrimitiveNode;
37-
3840const auto BOOL = std::make_shared<BooleanType>();
3941const auto UINT8 = std::make_shared<UInt8Type>();
4042const auto INT32 = std::make_shared<Int32Type>();
@@ -66,7 +68,7 @@ class TestConvertParquetSchema : public ::testing::Test {
6668 }
6769
6870 protected:
69- parquet_cpp ::SchemaDescriptor descr_;
71+ ::parquet ::SchemaDescriptor descr_;
7072 std::shared_ptr<Schema> result_schema_;
7173};
7274
@@ -75,40 +77,40 @@ TEST_F(TestConvertParquetSchema, ParquetFlatPrimitives) {
7577 std::vector<std::shared_ptr<Field>> arrow_fields;
7678
7779 parquet_fields.push_back (
78- PrimitiveNode::Make (" boolean" , Repetition::REQUIRED, parquet_cpp::Type ::BOOLEAN));
80+ PrimitiveNode::Make (" boolean" , Repetition::REQUIRED, ParquetType ::BOOLEAN));
7981 arrow_fields.push_back (std::make_shared<Field>(" boolean" , BOOL, false ));
8082
8183 parquet_fields.push_back (
82- PrimitiveNode::Make (" int32" , Repetition::REQUIRED, parquet_cpp::Type ::INT32));
84+ PrimitiveNode::Make (" int32" , Repetition::REQUIRED, ParquetType ::INT32));
8385 arrow_fields.push_back (std::make_shared<Field>(" int32" , INT32, false ));
8486
8587 parquet_fields.push_back (
86- PrimitiveNode::Make (" int64" , Repetition::REQUIRED, parquet_cpp::Type ::INT64));
88+ PrimitiveNode::Make (" int64" , Repetition::REQUIRED, ParquetType ::INT64));
8789 arrow_fields.push_back (std::make_shared<Field>(" int64" , INT64, false ));
8890
8991 parquet_fields.push_back (
90- PrimitiveNode::Make (" float" , Repetition::OPTIONAL, parquet_cpp::Type ::FLOAT));
92+ PrimitiveNode::Make (" float" , Repetition::OPTIONAL, ParquetType ::FLOAT));
9193 arrow_fields.push_back (std::make_shared<Field>(" float" , FLOAT));
9294
9395 parquet_fields.push_back (
94- PrimitiveNode::Make (" double" , Repetition::OPTIONAL, parquet_cpp::Type ::DOUBLE));
96+ PrimitiveNode::Make (" double" , Repetition::OPTIONAL, ParquetType ::DOUBLE));
9597 arrow_fields.push_back (std::make_shared<Field>(" double" , DOUBLE));
9698
9799 parquet_fields.push_back (
98100 PrimitiveNode::Make (" binary" , Repetition::OPTIONAL,
99- parquet_cpp::Type ::BYTE_ARRAY));
101+ ParquetType ::BYTE_ARRAY));
100102 arrow_fields.push_back (std::make_shared<Field>(" binary" , BINARY));
101103
102104 parquet_fields.push_back (
103105 PrimitiveNode::Make (" string" , Repetition::OPTIONAL,
104- parquet_cpp::Type ::BYTE_ARRAY,
105- parquet_cpp:: LogicalType::UTF8));
106+ ParquetType ::BYTE_ARRAY,
107+ LogicalType::UTF8));
106108 arrow_fields.push_back (std::make_shared<Field>(" string" , UTF8));
107109
108110 parquet_fields.push_back (
109111 PrimitiveNode::Make (" flba-binary" , Repetition::OPTIONAL,
110- parquet_cpp::Type ::FIXED_LEN_BYTE_ARRAY,
111- parquet_cpp:: LogicalType::NONE, 12 ));
112+ ParquetType ::FIXED_LEN_BYTE_ARRAY,
113+ LogicalType::NONE, 12 ));
112114 arrow_fields.push_back (std::make_shared<Field>(" flba-binary" , BINARY));
113115
114116 auto arrow_schema = std::make_shared<Schema>(arrow_fields);
@@ -121,18 +123,18 @@ TEST_F(TestConvertParquetSchema, UnsupportedThings) {
121123 std::vector<NodePtr> unsupported_nodes;
122124
123125 unsupported_nodes.push_back (
124- PrimitiveNode::Make (" int96" , Repetition::REQUIRED, parquet_cpp::Type ::INT96));
126+ PrimitiveNode::Make (" int96" , Repetition::REQUIRED, ParquetType ::INT96));
125127
126128 unsupported_nodes.push_back (
127129 GroupNode::Make (" repeated-group" , Repetition::REPEATED, {}));
128130
129131 unsupported_nodes.push_back (
130132 PrimitiveNode::Make (" int32" , Repetition::OPTIONAL,
131- parquet_cpp::Type:: INT32, parquet_cpp:: LogicalType::DATE));
133+ ParquetType:: INT32, LogicalType::DATE));
132134
133135 unsupported_nodes.push_back (
134136 PrimitiveNode::Make (" int64" , Repetition::OPTIONAL,
135- parquet_cpp::Type:: INT64, parquet_cpp:: LogicalType::TIMESTAMP_MILLIS));
137+ ParquetType:: INT64, LogicalType::TIMESTAMP_MILLIS));
136138
137139 for (const NodePtr& node : unsupported_nodes) {
138140 ASSERT_RAISES (NotImplemented, ConvertSchema ({node}));
0 commit comments