Skip to content

Commit

Permalink
scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
akuzm committed Apr 10, 2024
1 parent 76d6b59 commit 4568d62
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
10 changes: 5 additions & 5 deletions tsl/src/nodes/decompress_chunk/compressed_batch.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ decompress_column(DecompressContext *dcontext, DecompressBatchState *batch_state
* The column will have a default value for the entire batch,
* set it now.
*/
column_values->decompression_type = DT_Default;
column_values->decompression_type = DT_Scalar;

*column_values->output_value =
getmissingattr(dcontext->decompressed_slot->tts_tupleDescriptor,
Expand Down Expand Up @@ -443,7 +443,7 @@ compute_plain_qual(DecompressContext *dcontext, DecompressBatchState *batch_stat
* with this default value, check if it passes the predicate, and apply
* it to the entire batch.
*/
Assert(column_values->decompression_type == DT_Default);
Assert(column_values->decompression_type == DT_Scalar);

/*
* We saved the actual default value into the decompressed scan slot
Expand Down Expand Up @@ -547,7 +547,7 @@ compute_plain_qual(DecompressContext *dcontext, DecompressBatchState *batch_stat
/* Translate the result if the column had a default value. */
if (column_values->arrow == NULL)
{
Assert(column_values->decompression_type == DT_Default);
Assert(column_values->decompression_type == DT_Scalar);
if (!(default_value_predicate_result[0] & 1))
{
/*
Expand Down Expand Up @@ -837,7 +837,7 @@ compressed_batch_set_compressed_tuple(DecompressContext *dcontext,

Assert(i < dcontext->num_data_columns);
CompressedColumnValues *column_values = &batch_state->compressed_columns[i];
column_values->decompression_type = DT_Default;
column_values->decompression_type = DT_Scalar;

/*
* Note that if it's not a by-value type, we should copy it into
Expand Down Expand Up @@ -1038,7 +1038,7 @@ make_next_tuple(DecompressBatchState *batch_state, uint16 arrow_row, int num_dat
else
{
/* A compressed column with default value, do nothing. */
Assert(column_values->decompression_type == DT_Default);
Assert(column_values->decompression_type == DT_Scalar);
}
}

Expand Down
14 changes: 12 additions & 2 deletions tsl/src/nodes/decompress_chunk/compressed_batch.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,23 @@ typedef struct ArrowArray ArrowArray;
typedef enum
{
DT_ArrowTextDict = -4,

DT_ArrowText = -3,
DT_Default = -2,

/*
* The decompressed value is already in the decompressed slot. This is used
* for segmentby and compressed columns with default value in batch.
*/
DT_Scalar = -2,

DT_Iterator = -1,

DT_Invalid = 0,

/*
* Any positive number is also valid for the decompression type. It means
* arrow array of a fixed-size by-value type, with size given by the number.
* arrow array of a fixed-size by-value type, with size in bytes given by
* the number.
*/
} DecompressionType;

Expand Down

0 comments on commit 4568d62

Please sign in to comment.