Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass RowDecompressor by reference in build_scankeys #6247

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions tsl/src/compression/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,7 @@ compression_get_toast_storage(CompressionAlgorithms algorithm)
* columns of the uncompressed chunk.
*/
static ScanKeyData *
build_scankeys(int32 hypertable_id, Oid hypertable_relid, RowDecompressor decompressor,
build_scankeys(int32 hypertable_id, Oid hypertable_relid, RowDecompressor *decompressor,
Bitmapset *key_columns, Bitmapset **null_columns, TupleTableSlot *slot,
int *num_scankeys)
{
Expand All @@ -1903,7 +1903,7 @@ build_scankeys(int32 hypertable_id, Oid hypertable_relid, RowDecompressor decomp
while ((i = bms_next_member(key_columns, i)) > 0)
{
AttrNumber attno = i + FirstLowInvalidHeapAttributeNumber;
char *attname = get_attname(decompressor.out_rel->rd_id, attno, false);
char *attname = get_attname(decompressor->out_rel->rd_id, attno, false);
FormData_hypertable_compression *fd =
ts_hypertable_compression_get_by_pkey(hypertable_id, attname);
bool isnull;
Expand All @@ -1927,7 +1927,7 @@ build_scankeys(int32 hypertable_id, Oid hypertable_relid, RowDecompressor decomp
*/
if (COMPRESSIONCOL_IS_SEGMENT_BY(fd))
{
key_index = create_segment_filter_scankey(&decompressor,
key_index = create_segment_filter_scankey(decompressor,
attname,
BTEqualStrategyNumber,
scankeys,
Expand All @@ -1944,15 +1944,15 @@ build_scankeys(int32 hypertable_id, Oid hypertable_relid, RowDecompressor decomp
if (isnull)
continue;

key_index = create_segment_filter_scankey(&decompressor,
key_index = create_segment_filter_scankey(decompressor,
compression_column_segment_min_name(fd),
BTLessEqualStrategyNumber,
scankeys,
key_index,
null_columns,
value,
false); /* is_null_check */
key_index = create_segment_filter_scankey(&decompressor,
key_index = create_segment_filter_scankey(decompressor,
compression_column_segment_max_name(fd),
BTGreaterEqualStrategyNumber,
scankeys,
Expand Down Expand Up @@ -2074,7 +2074,7 @@ decompress_batches_for_insert(ChunkInsertState *cis, Chunk *chunk, TupleTableSlo
int num_scankeys;
ScanKeyData *scankeys = build_scankeys(chunk->fd.hypertable_id,
chunk->hypertable_relid,
decompressor,
&decompressor,
key_columns,
&null_columns,
slot,
Expand Down