Skip to content

Commit

Permalink
arrow-fdw: incorrect record-batch index calculation
Browse files Browse the repository at this point in the history
issue reported at #831
  • Loading branch information
kaigai committed Oct 14, 2024
1 parent 1a9fd3d commit 2968a6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/arrow_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -3641,9 +3641,9 @@ __arrowFdwNextRecordBatch(ArrowFdwState *arrow_state,
raw_index = pg_atomic_fetch_add_u32(arrow_state->rbatch_index, 1);
if (raw_index >= arrow_state->rb_nitems * num_scan_repeats)
return NULL; /* no more chunks to load */
rb_index = (raw_index % num_scan_repeats);
rb_index = (raw_index % arrow_state->rb_nitems);
if (p_scan_repeat_id)
*p_scan_repeat_id = (raw_index / num_scan_repeats);
*p_scan_repeat_id = (raw_index / arrow_state->rb_nitems);
rb_state = arrow_state->rb_states[rb_index];
if (arrow_state->stats_hint)
{
Expand Down

0 comments on commit 2968a6c

Please sign in to comment.