Materialize all active streams, fetching remaining data into memory.
29990 {
29992 for (auto *result_wrapper : active_streams) {
29993 if (!result_wrapper || result_wrapper->materialized) {
29994 continue;
29995 }
29996
29997
29999 auto arrow_options = duckdb_result_get_arrow_options(&result_wrapper->result);
30000 while (true) {
30003
30004 auto duckdb_chunk = duckdb_fetch_chunk(result_wrapper->result);
30005 if (!duckdb_chunk) {
30006 break;
30007 }
30008 auto conversion_err = duckdb_data_chunk_to_arrow(arrow_options, duckdb_chunk, &array);
30009 duckdb_destroy_data_chunk(&duckdb_chunk);
30010
30011 if (conversion_err) {
30012 duckdb_destroy_error_data(&conversion_err);
30015 }
30016 break;
30017 }
30018 batches.push_back(array);
30019 }
30020 duckdb_destroy_arrow_options(&arrow_options);
30021
30022
30024 if (!mat) {
30025
30026 for (auto &batch : batches) {
30027 if (batch.release) {
30028 batch.release(&batch);
30029 }
30030 }
30031 continue;
30032 }
30033 mat->current = 0;
30034 mat->count = static_cast<idx_t>(batches.size());
30035 if (!batches.empty()) {
30037 if (!mat->batches) {
30038
30039 for (auto &batch : batches) {
30040 if (batch.release) {
30042 }
30043 }
30044 free(mat);
30045 continue;
30046 }
30047 for (idx_t i = 0; i < batches.size(); i++) {
30048 mat->batches[i] = batches[i];
30049 }
30050 } else {
30051 mat->batches = nullptr;
30052 }
30053 result_wrapper->materialized = mat;
30054 }
30055}
Definition duckdb.hpp:11287
void(* release)(struct ArrowArray *)
Release callback.
Definition duckdb.hpp:11299
Definition duckdb.cpp:27712