MCPcopy Create free account
hub / github.com/apache/arrow / CheckColumn

Method CheckColumn

cpp/src/parquet/stream_writer.cc:192–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void 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
223int64_t StreamWriter::SkipColumns(int num_columns_to_skip) {
224 int num_columns_skipped = 0;

Callers

nothing calls this directly

Calls 8

ParquetExceptionFunction · 0.85
to_stringFunction · 0.85
TypeToStringFunction · 0.85
ConvertedTypeToStringFunction · 0.85
physical_typeMethod · 0.80
type_lengthMethod · 0.80
sizeMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected