| 190 | } |
| 191 | |
| 192 | void StreamWriter::CheckColumn(Type::type physical_type, |
| 193 | ConvertedType::type converted_type, int length) { |
| 194 | if (static_cast<std::size_t>(column_index_) >= nodes_.size()) { |
| 195 | throw ParquetException("Column index out-of-bounds. Index " + |
| 196 | std::to_string(column_index_) + " is invalid for " + |
| 197 | std::to_string(nodes_.size()) + " columns"); |
| 198 | } |
| 199 | const auto& node = nodes_[column_index_]; |
| 200 | |
| 201 | if (physical_type != node->physical_type()) { |
| 202 | throw ParquetException("Column physical type mismatch. Column '" + node->name() + |
| 203 | "' has physical type '" + TypeToString(node->physical_type()) + |
| 204 | "' not '" + TypeToString(physical_type) + "'"); |
| 205 | } |
| 206 | if (converted_type != node->converted_type()) { |
| 207 | throw ParquetException("Column converted type mismatch. Column '" + node->name() + |
| 208 | "' has converted type[" + |
| 209 | ConvertedTypeToString(node->converted_type()) + "] not '" + |
| 210 | ConvertedTypeToString(converted_type) + "'"); |
| 211 | } |
| 212 | // Length must be exact. |
| 213 | // A shorter length fixed array is not acceptable as it would |
| 214 | // result in array bound read errors. |
| 215 | // |
| 216 | if (length != node->type_length()) { |
| 217 | throw ParquetException("Column length mismatch. Column '" + node->name() + |
| 218 | "' has length " + std::to_string(node->type_length()) + |
| 219 | " not " + std::to_string(length)); |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | int64_t StreamWriter::SkipColumns(int num_columns_to_skip) { |
| 224 | int num_columns_skipped = 0; |
nothing calls this directly
no test coverage detected