Skip to content

Commit

Permalink
Interface changes for the serialized hashing strategy
Browse files Browse the repository at this point in the history
It needs to know the value size.
  • Loading branch information
akuzm authored and erimatnor committed Feb 13, 2025
1 parent eea2895 commit 1464965
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions tsl/src/nodes/vector_agg/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ get_input_offset(const CustomScanState *state, const Var *var)
return index;
}

static int
get_value_bytes(const CustomScanState *state, int input_offset)
static void
get_column_storage_properties(const CustomScanState *state, int input_offset,
GroupingColumn *result)
{
const DecompressChunkState *decompress_state = (DecompressChunkState *) state;
const DecompressContext *dcontext = &decompress_state->decompress_context;
const CompressionColumnDescription *desc = &dcontext->compressed_chunk_columns[input_offset];
return desc->value_bytes;
result->value_bytes = desc->value_bytes;
result->by_value = desc->by_value;
}

static void
Expand Down Expand Up @@ -187,7 +189,7 @@ vector_agg_begin(CustomScanState *node, EState *estate, int eflags)

Var *var = castNode(Var, tlentry->expr);
col->input_offset = get_input_offset(childstate, var);
col->value_bytes = get_value_bytes(childstate, col->input_offset);
get_column_storage_properties(childstate, col->input_offset, col);
}
}

Expand Down
4 changes: 3 additions & 1 deletion tsl/src/nodes/vector_agg/exec.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ typedef struct GroupingColumn
{
int input_offset;
int output_offset;
int value_bytes;

int16 value_bytes;
bool by_value;
} GroupingColumn;

typedef struct VectorAggState
Expand Down

0 comments on commit 1464965

Please sign in to comment.