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

Function VerifyStringAndNumber_FixedWidth

cpp/src/arrow/acero/tpch_node_test.cc:127–144  ·  view source on GitHub ↗

Verifies that each row is the string "prefix" followed by a number. If numbers is not EMPTY, it also checks that the number following the prefix is equal to the corresponding row in numbers. Some TPC-H data is padded to 9 zeros, which this function can optionally verify as well. This string function verifies fixed width columns.

Source from the content-addressed store, hash-verified

125// corresponding row in numbers. Some TPC-H data is padded to 9 zeros, which this function
126// can optionally verify as well. This string function verifies fixed width columns.
127void VerifyStringAndNumber_FixedWidth(const Datum& strings, const Datum& numbers,
128 int byte_width, std::string_view prefix,
129 bool verify_padding = true) {
130 int64_t length = strings.length();
131 const char* str = reinterpret_cast<const char*>(strings.array()->buffers[1]->data());
132
133 const int32_t* nums = nullptr;
134 if (numbers.kind() != Datum::NONE) {
135 ASSERT_EQ(length, numbers.length());
136 nums = reinterpret_cast<const int32_t*>(numbers.array()->buffers[1]->data());
137 }
138
139 for (int64_t i = 0; i < length; i++) {
140 const char* row = str + i * byte_width;
141 std::string_view view(row, byte_width);
142 VerifyStringAndNumber_Single(view, prefix, i, nums, verify_padding);
143 }
144}
145
146// Same as above but for variable length columns
147void VerifyStringAndNumber_Varlen(const Datum& strings, const Datum& numbers,

Callers 3

VerifySupplierFunction · 0.85
VerifyPartFunction · 0.85
VerifyOrdersFunction · 0.85

Calls 5

lengthMethod · 0.45
dataMethod · 0.45
arrayMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected