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

Class ListImpl

cpp/src/arrow/array/diff.cc:704–721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

702 template <typename T>
703 enable_if_list_like<T, Status> Visit(const T& t) {
704 struct ListImpl {
705 explicit ListImpl(Formatter f) : values_formatter_(std::move(f)) {}
706
707 void operator()(const Array& array, int64_t index, std::ostream* os) {
708 const auto& list_array =
709 checked_cast<const typename TypeTraits<T>::ArrayType&>(array);
710 *os << "[";
711 for (int32_t i = 0; i < list_array.value_length(index); ++i) {
712 if (i != 0) {
713 *os << ", ";
714 }
715 values_formatter_(*list_array.values(), i + list_array.value_offset(index), os);
716 }
717 *os << "]";
718 }
719
720 Formatter values_formatter_;
721 };
722
723 ARROW_ASSIGN_OR_RAISE(auto values_formatter, MakeFormatter(*t.value_type()));
724 impl_ = ListImpl(std::move(values_formatter));

Callers 1

VisitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected