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

Method S_NAME

cpp/src/arrow/acero/tpch_node.cc:2552–2572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2550 }
2551
2552 Status S_NAME(size_t thread_index) {
2553 ThreadLocalData& tld = thread_local_data_[thread_index];
2554 if (tld.batch[SUPPLIER::S_NAME].kind() == Datum::NONE) {
2555 RETURN_NOT_OK(S_SUPPKEY(thread_index));
2556 const int32_t* s_suppkey = reinterpret_cast<const int32_t*>(
2557 tld.batch[SUPPLIER::S_SUPPKEY].array()->buffers[1]->data());
2558 RETURN_NOT_OK(AllocateColumn(thread_index, SUPPLIER::S_NAME));
2559 int32_t byte_width = kTypes[SUPPLIER::S_NAME]->byte_width();
2560 char* s_name = reinterpret_cast<char*>(
2561 tld.batch[SUPPLIER::S_NAME].array()->buffers[1]->mutable_data());
2562 // Look man, I'm just following the spec ok? Section 4.2.3 as of March 1 2022
2563 const char* supplier = "Supplie#r";
2564 const size_t supplier_length = std::strlen(supplier);
2565 for (int64_t irow = 0; irow < tld.to_generate; irow++) {
2566 char* out = s_name + byte_width * irow;
2567 std::strncpy(out, supplier, byte_width);
2568 AppendNumberPaddedToNineDigits(out + supplier_length, s_suppkey[irow]);
2569 }
2570 }
2571 return Status::OK();
2572 }
2573
2574 Status S_ADDRESS(size_t thread_index) {
2575 ThreadLocalData& tld = thread_local_data_[thread_index];

Callers

nothing calls this directly

Calls 7

OKFunction · 0.50
kindMethod · 0.45
dataMethod · 0.45
arrayMethod · 0.45
byte_widthMethod · 0.45
mutable_dataMethod · 0.45

Tested by

no test coverage detected