This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 378789ba8a [Fix](parquet-reader) Fix dict_filter crashed caused by
VDirectInPredicate checking expr result is not nullable. (#17924)
378789ba8a is described below
commit 378789ba8a42d9aab487c5ede9d3a8decae80028
Author: Qi Chen <[email protected]>
AuthorDate: Mon Mar 20 00:02:59 2023 +0800
[Fix](parquet-reader) Fix dict_filter crashed caused by VDirectInPredicate
checking expr result is not nullable. (#17924)
Be crashed in parquet dict_filter function caused by VDirectInPredicate
checking expr result is not nullable.
---
be/src/vec/exec/format/parquet/vparquet_group_reader.cpp | 9 +++++++--
be/src/vec/exec/format/parquet/vparquet_group_reader.h | 2 +-
2 files changed, 8 insertions(+), 3 deletions(-)
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 b48cd722b6..93798c0b6e 100644
--- a/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp
+++ b/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp
@@ -769,13 +769,14 @@ Status RowGroupReader::_rewrite_dict_predicates() {
}
// 4. Rewrite conjuncts.
- _rewrite_dict_conjuncts(dict_codes, slot_id);
+ _rewrite_dict_conjuncts(dict_codes, slot_id,
dict_column->is_nullable());
++it;
}
return Status::OK();
}
-Status RowGroupReader::_rewrite_dict_conjuncts(std::vector<int32_t>&
dict_codes, int slot_id) {
+Status RowGroupReader::_rewrite_dict_conjuncts(std::vector<int32_t>&
dict_codes, int slot_id,
+ bool is_nullable) {
VExpr* root;
if (dict_codes.size() == 1) {
{
@@ -800,6 +801,7 @@ Status
RowGroupReader::_rewrite_dict_conjuncts(std::vector<int32_t>& dict_codes,
texpr_node.__set_fn(fn);
texpr_node.__set_child_type(TPrimitiveType::INT);
texpr_node.__set_num_children(2);
+ texpr_node.__set_is_nullable(is_nullable);
root = _obj_pool->add(new VectorizedFnCall(texpr_node));
}
{
@@ -821,6 +823,7 @@ Status
RowGroupReader::_rewrite_dict_conjuncts(std::vector<int32_t>& dict_codes,
TIntLiteral int_literal;
int_literal.__set_value(dict_codes[0]);
texpr_node.__set_int_literal(int_literal);
+ texpr_node.__set_is_nullable(is_nullable);
VExpr* literal_expr = _obj_pool->add(new VLiteral(texpr_node));
root->add_child(literal_expr);
}
@@ -834,6 +837,8 @@ Status
RowGroupReader::_rewrite_dict_conjuncts(std::vector<int32_t>& dict_codes,
node.__set_opcode(TExprOpcode::FILTER_IN);
node.__isset.vector_opcode = true;
node.__set_vector_opcode(TExprOpcode::FILTER_IN);
+ // VdirectInPredicate assume is_nullable = false.
+ node.__set_is_nullable(false);
root = _obj_pool->add(new vectorized::VDirectInPredicate(node));
std::shared_ptr<HybridSetBase>
hybrid_set(create_set(PrimitiveType::TYPE_INT));
diff --git a/be/src/vec/exec/format/parquet/vparquet_group_reader.h
b/be/src/vec/exec/format/parquet/vparquet_group_reader.h
index 99cb6cb85a..3768bf49c9 100644
--- a/be/src/vec/exec/format/parquet/vparquet_group_reader.h
+++ b/be/src/vec/exec/format/parquet/vparquet_group_reader.h
@@ -147,7 +147,7 @@ private:
const tparquet::ColumnMetaData& column_metadata);
bool is_dictionary_encoded(const tparquet::ColumnMetaData&
column_metadata);
Status _rewrite_dict_predicates();
- Status _rewrite_dict_conjuncts(std::vector<int32_t>& dict_codes, int
slot_id);
+ Status _rewrite_dict_conjuncts(std::vector<int32_t>& dict_codes, int
slot_id, bool is_nullable);
void _convert_dict_cols_to_string_cols(Block* block);
Status _execute_conjuncts(const std::vector<VExprContext*>& ctxs,
const std::vector<IColumn::Filter*>& filters,
Block* block,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]