#include <stddef.h>
#include "c_types/matrix_cell_t.h"
Go to the source code of this file.
◆ pgr_get_matrixRows()
void pgr_get_matrixRows |
( |
char * |
sql, |
|
|
Matrix_cell_t ** |
distaces, |
|
|
size_t * |
total_distances |
|
) |
| |
bigint start_vid, bigint end_vid, float agg_cost,
Definition at line 56 of file matrixRows_input.c.
60 clock_t start_t = clock();
62 const int tuple_limit = 1000000;
64 size_t total_tuples = 0;
69 for (i = 0; i < 3; ++i) {
75 info[0].
name =
"start_vid";
76 info[1].
name =
"end_vid";
77 info[2].
name =
"agg_cost";
90 (*total_rows) = total_tuples;
92 while (moredata ==
true) {
93 SPI_cursor_fetch(SPIportal,
true, tuple_limit);
94 if (total_tuples == 0)
97 size_t ntuples = SPI_processed;
98 total_tuples += ntuples;
108 if ((*rows) == NULL) {
109 elog(ERROR,
"Out of memory");
112 SPITupleTable *tuptable = SPI_tuptable;
113 TupleDesc tupdesc = SPI_tuptable->tupdesc;
114 PGR_DBG(
"processing %ld matrix cell tupĺes", ntuples);
117 for (t = 0; t < ntuples; t++) {
118 HeapTuple tuple = tuptable->vals[t];
120 &(*rows)[total_tuples - ntuples + t]);
122 SPI_freetuptable(tuptable);
128 SPI_cursor_close(SPIportal);
131 if (total_tuples == 0) {
137 (*total_rows) = total_tuples;
138 time_msg(
" reading matrix cells", start_t, clock());
References ANY_INTEGER, ANY_NUMERICAL, Column_info_t::colNumber, Column_info_t::eType, Column_info_t::name, PGR_DBG, pgr_fetch_column_info(), pgr_fetch_row(), pgr_SPI_cursor_open(), pgr_SPI_prepare(), Column_info_t::strict, time_msg(), and Column_info_t::type.
Referenced by process().