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

Method CheckIndex

cpp/src/arrow/compute/kernels/scalar_nested.cc:608–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

606 }
607
608 static Status CheckIndex(int index, const DataType& type) {
609 if (!ValidParentType(type)) {
610 return Status::TypeError("struct_field: cannot subscript field of type ", type);
611 } else if (index < 0 || index >= type.num_fields()) {
612 return Status::Invalid("struct_field: out-of-bounds field reference to field ",
613 index, " in type ", type, " with ", type.num_fields(),
614 " fields");
615 }
616 return Status::OK();
617 }
618
619 static bool ValidParentType(const DataType& type) {
620 return type.id() == Type::STRUCT || type.id() == Type::DENSE_UNION ||

Callers

nothing calls this directly

Calls 4

TypeErrorFunction · 0.50
InvalidFunction · 0.50
OKFunction · 0.50
num_fieldsMethod · 0.45

Tested by

no test coverage detected