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

Method field

cpp/src/arrow/scalar.cc:723–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721}
722
723Result<std::shared_ptr<Scalar>> StructScalar::field(FieldRef ref) const {
724 ARROW_ASSIGN_OR_RAISE(auto path, ref.FindOne(*type));
725 if (path.indices().size() != 1) {
726 return Status::NotImplemented("retrieval of nested fields from StructScalar");
727 }
728 auto index = path.indices()[0];
729 if (is_valid) {
730 return value[index];
731 } else {
732 const auto& struct_type = checked_cast<const StructType&>(*this->type);
733 const auto& field_type = struct_type.field(index)->type();
734 return MakeNullScalar(field_type);
735 }
736}
737
738RunEndEncodedScalar::RunEndEncodedScalar(std::shared_ptr<Scalar> value,
739 std::shared_ptr<DataType> type)

Callers 15

test_fieldMethod · 0.45
test_fieldMethod · 0.45
test_fieldMethod · 0.45
test_data_typeMethod · 0.45
test_fieldMethod · 0.45
garrow_schema_get_fieldFunction · 0.45
dataframe_to_arraysFunction · 0.45

Calls 5

MakeNullScalarFunction · 0.85
indicesMethod · 0.80
NotImplementedFunction · 0.70
sizeMethod · 0.45
typeMethod · 0.45

Tested by 15

test_fieldMethod · 0.36
test_fieldMethod · 0.36
test_fieldMethod · 0.36
test_data_typeMethod · 0.36
test_fieldMethod · 0.36
test_tree_exp_builderFunction · 0.36
test_tableFunction · 0.36
test_filterFunction · 0.36
test_in_exprFunction · 0.36
test_in_expr_todoFunction · 0.36
test_booleanFunction · 0.36
test_regexFunction · 0.36