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

Method ToTable

cpp/src/arrow/compute/kernels/vector_sort.cc:893–907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891
892 private:
893 static Result<std::shared_ptr<Table>> ToTable(
894 const std::shared_ptr<ChunkedArray>& chunked_array) {
895 if (chunked_array->null_count() == 0) {
896 return Table::FromChunkedStructArray(chunked_array);
897 }
898 // We avoid using `Table::FromChunkedStructArray` here since it doesn't take top-level
899 // validity into account for the columns.
900 //
901 // TODO: We could instead use the provided sort keys to only flatten the selected
902 // columns (via `GetFlattenedField`). Same for the Array -> RecordBatch conversion,
903 // since `RecordBatch::FromStructArray` flattens all columns as well.
904 ARROW_ASSIGN_OR_RAISE(auto columns, chunked_array->Flatten());
905 return Table::Make(schema(chunked_array->type()->fields()), std::move(columns),
906 chunked_array->length());
907 }
908
909 Result<Datum> SortIndices(const Array& values, const SortOptions& options,
910 ExecContext* ctx) const {

Callers

nothing calls this directly

Calls 6

MakeFunction · 0.50
schemaFunction · 0.50
null_countMethod · 0.45
fieldsMethod · 0.45
typeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected