MCPcopy Create free account
hub / github.com/bytedance/bolt / call

Method call

bolt/functions/sparksql/ArrayFlattenFunction.h:45–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 static constexpr int32_t kMaxNumberOfElements = 2147483632;
44
45 FOLLY_ALWAYS_INLINE bool call(
46 out_type<Array<Generic<T1>>>& out,
47 const arg_type<Array<Array<Generic<T1>>>>& arrays) {
48 int64_t elementCount = 0;
49 for (const auto& array : arrays) {
50 if (array.has_value()) {
51 elementCount += array.value().size();
52 } else {
53 // Return NULL if any of the nested arrays is NULL.
54 return false;
55 }
56 }
57
58 BOLT_USER_CHECK_LE(
59 elementCount,
60 kMaxNumberOfElements,
61 "array flatten result exceeds the max array size limit {}",
62 kMaxNumberOfElements);
63
64 out.reserve(elementCount);
65 for (const auto& array : arrays) {
66 out.add_items(array.value());
67 };
68 return true;
69 }
70};
71} // namespace bytedance::bolt::functions::sparksql

Callers

nothing calls this directly

Calls 5

has_valueMethod · 0.80
add_itemsMethod · 0.80
sizeMethod · 0.45
valueMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected