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

Function TraverseDots

r/src/arrow_types.h:213–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211
212template <typename Lambda>
213void TraverseDots(cpp11::list dots, int num_fields, Lambda lambda) {
214 cpp11::strings names(dots.attr(R_NamesSymbol));
215
216 for (int i = 0, j = 0; j < num_fields; i++) {
217 auto name_i = names[i];
218
219 if (name_i.size() == 0) {
220 cpp11::list x_i = dots[i];
221 cpp11::strings names_x_i(x_i.attr(R_NamesSymbol));
222 R_xlen_t n_i = x_i.size();
223 for (R_xlen_t k = 0; k < n_i; k++, j++) {
224 lambda(j, x_i[k], names_x_i[k]);
225 }
226 } else {
227 lambda(j, dots[i], name_i);
228 j++;
229 }
230 }
231}
232
233inline cpp11::writable::list FlattenDots(cpp11::list dots, int num_fields) {
234 std::vector<SEXP> out(num_fields);

Callers 6

FlattenDotsFunction · 0.85
CollectRecordBatchArraysFunction · 0.85
Table__from_dotsFunction · 0.85
InferSchemaFromDotsFunction · 0.85
CollectColumnMetadataFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected