MCPcopy Create free account
hub / github.com/apache/madlib / SRF_next

Method SRF_next

src/modules/lda/lda.cpp:495–515  ·  view source on GitHub ↗

* @brief The function is used to return the next row by the SRF.. **/

Source from the content-addressed store, hash-verified

493 * @brief The function is used to return the next row by the SRF..
494 **/
495AnyType lda_unnest_transpose::SRF_next(void *user_fctx, bool *is_last_call)
496{
497 sr_ctx * ctx = (sr_ctx *) user_fctx;
498 if (ctx->maxcall == ctx->curcall) {
499 *is_last_call = true;
500 return Null();
501 }
502
503 MutableArrayHandle<int32_t> outarray(
504 madlib_construct_array(
505 NULL, ctx->dim, INT4TI.oid, INT4TI.len, INT4TI.byval,
506 INT4TI.align));
507 for (int i = 0; i < ctx->dim; i ++) {
508 outarray[i] = ctx->inarray[(ctx->maxcall + 1) * i + ctx->curcall];
509 }
510
511 ctx->curcall++;
512 *is_last_call = false;
513
514 return outarray;
515}
516// -----------------------------------------------------------------------
517
518void * lda_unnest::SRF_init(AnyType &args)

Callers 1

SRF_invokeMethod · 0.45

Calls 2

NullFunction · 0.85
madlib_construct_arrayFunction · 0.50

Tested by

no test coverage detected