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

Method field

cpp/src/arrow/scalar.cc:721–734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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