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

Method SetUp

cpp/src/arrow/scalar_test.cc:1883–1901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1881 using ScalarType = typename TypeTraits<UnionType>::ScalarType;
1882
1883 void SetUp() {
1884 type_.reset(new UnionType({field("string", utf8()), field("number", uint64()),
1885 field("other_number", uint64())},
1886 /*type_codes=*/{3, 42, 43}));
1887 union_type_ = static_cast<const Type*>(type_.get());
1888
1889 alpha_ = MakeScalar("alpha");
1890 beta_ = MakeScalar("beta");
1891 ASSERT_OK_AND_ASSIGN(two_, MakeScalar(uint64(), 2));
1892 ASSERT_OK_AND_ASSIGN(three_, MakeScalar(uint64(), 3));
1893
1894 union_alpha_ = ScalarFromValue(0, alpha_);
1895 union_beta_ = ScalarFromValue(0, beta_);
1896 union_two_ = ScalarFromValue(1, two_);
1897 union_other_two_ = ScalarFromValue(2, two_);
1898 union_three_ = ScalarFromValue(1, three_);
1899 union_string_null_ = SpecificNull(0);
1900 union_number_null_ = SpecificNull(1);
1901 }
1902
1903 std::shared_ptr<Scalar> ScalarFromValue(int field_index,
1904 std::shared_ptr<Scalar> field_value) {

Callers

nothing calls this directly

Calls 5

MakeScalarFunction · 0.85
fieldFunction · 0.70
ASSERT_OK_AND_ASSIGNFunction · 0.70
resetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected