| 159 | void TearDown() override { reader_ = StreamReader{}; } |
| 160 | |
| 161 | std::shared_ptr<schema::GroupNode> GetSchema() { |
| 162 | schema::NodeVector fields; |
| 163 | |
| 164 | fields.push_back(schema::PrimitiveNode::Make("bool_field", Repetition::REQUIRED, |
| 165 | Type::BOOLEAN, ConvertedType::NONE)); |
| 166 | |
| 167 | fields.push_back(schema::PrimitiveNode::Make("string_field", Repetition::REQUIRED, |
| 168 | Type::BYTE_ARRAY, ConvertedType::UTF8)); |
| 169 | |
| 170 | fields.push_back(schema::PrimitiveNode::Make("char_field", Repetition::REQUIRED, |
| 171 | Type::FIXED_LEN_BYTE_ARRAY, |
| 172 | ConvertedType::NONE, 1)); |
| 173 | |
| 174 | fields.push_back(schema::PrimitiveNode::Make("char[4]_field", Repetition::REQUIRED, |
| 175 | Type::FIXED_LEN_BYTE_ARRAY, |
| 176 | ConvertedType::NONE, 4)); |
| 177 | |
| 178 | fields.push_back(schema::PrimitiveNode::Make("int8_field", Repetition::REQUIRED, |
| 179 | Type::INT32, ConvertedType::INT_8)); |
| 180 | |
| 181 | fields.push_back(schema::PrimitiveNode::Make("uint16_field", Repetition::REQUIRED, |
| 182 | Type::INT32, ConvertedType::UINT_16)); |
| 183 | |
| 184 | fields.push_back(schema::PrimitiveNode::Make("int32_field", Repetition::REQUIRED, |
| 185 | Type::INT32, ConvertedType::INT_32)); |
| 186 | |
| 187 | fields.push_back(schema::PrimitiveNode::Make("uint64_field", Repetition::REQUIRED, |
| 188 | Type::INT64, ConvertedType::UINT_64)); |
| 189 | |
| 190 | fields.push_back(schema::PrimitiveNode::Make("chrono_microseconds_field", |
| 191 | Repetition::REQUIRED, Type::INT64, |
| 192 | ConvertedType::TIMESTAMP_MICROS)); |
| 193 | |
| 194 | fields.push_back(schema::PrimitiveNode::Make("float_field", Repetition::REQUIRED, |
| 195 | Type::FLOAT, ConvertedType::NONE)); |
| 196 | |
| 197 | fields.push_back(schema::PrimitiveNode::Make("double_field", Repetition::REQUIRED, |
| 198 | Type::DOUBLE, ConvertedType::NONE)); |
| 199 | |
| 200 | return std::static_pointer_cast<schema::GroupNode>( |
| 201 | schema::GroupNode::Make("schema", Repetition::REQUIRED, fields)); |
| 202 | } |
| 203 | |
| 204 | void CreateTestFile() { |
| 205 | PARQUET_ASSIGN_OR_THROW(auto outfile, |