From b50e2a8c0800c4ff1d76e2acbda3db900af0ed4e Mon Sep 17 00:00:00 2001 From: Qi Chen Date: Sun, 7 May 2023 10:05:23 +0800 Subject: [PATCH] [Fix](parquet-reader) Fix dict cols not be converted back to string type in some cases. (#19348) Fix dict cols not be converted back to string type in some cases, which includes introduced by #19039. For dict cols, we will convert dict cols to int32 type firstly, then convert back to string type after read block. The block will be reuse it, so it is necessary to convert it back. --- be/src/vec/exec/format/parquet/vparquet_group_reader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp b/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp index 285d2d55ec..cb0f6ddca0 100644 --- a/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp +++ b/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp @@ -301,6 +301,7 @@ Status RowGroupReader::next_batch(Block* block, size_t batch_size, size_t* read_ RETURN_IF_ERROR(_fill_missing_columns(block, *read_rows, _lazy_read_ctx.missing_columns)); if (block->rows() == 0) { + _convert_dict_cols_to_string_cols(block); *read_rows = block->rows(); return Status::OK(); } @@ -457,6 +458,7 @@ Status RowGroupReader::_do_lazy_read(Block* block, size_t batch_size, size_t* re *read_rows = 0; *batch_eof = true; _lazy_read_filtered_rows += pre_read_rows; + _convert_dict_cols_to_string_cols(block); return Status::OK(); } } else {