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

Method CheckColumn

cpp/src/parquet/stream_reader.cc:517–551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517void StreamReader::CheckColumn(Type::type physical_type,
518 ConvertedType::type converted_type, int length) {
519 if (static_cast<std::size_t>(column_index_) >= nodes_.size()) {
520 if (eof_) {
521 ParquetException::EofException();
522 }
523 throw ParquetException("Column index out-of-bounds. Index " +
524 std::to_string(column_index_) + " is invalid for " +
525 std::to_string(nodes_.size()) + " columns");
526 }
527 const auto& node = nodes_[column_index_];
528
529 if (physical_type != node->physical_type()) {
530 throw ParquetException("Column physical type mismatch. Column '" + node->name() +
531 "' has physical type '" + TypeToString(node->physical_type()) +
532 "' not '" + TypeToString(physical_type) + "'");
533 }
534 if (converted_type != node->converted_type()) {
535 // The converted type does not always match with the value
536 // provided so check the set of exceptions.
537 if (converted_type_exceptions.find({converted_type, node->converted_type()}) ==
538 converted_type_exceptions.end()) {
539 throw ParquetException("Column converted type mismatch. Column '" + node->name() +
540 "' has converted type '" +
541 ConvertedTypeToString(node->converted_type()) + "' not '" +
542 ConvertedTypeToString(converted_type) + "'");
543 }
544 }
545 // Length must be exact.
546 if (length != node->type_length()) {
547 throw ParquetException("Column length mismatch. Column '" + node->name() +
548 "' has length " + std::to_string(node->type_length()) +
549 "] not " + std::to_string(length));
550 }
551} // namespace parquet
552
553void StreamReader::ThrowReadFailedException(
554 const std::shared_ptr<schema::PrimitiveNode>& node) {

Callers

nothing calls this directly

Calls 10

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
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected