Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion be/src/vec/exec/format/orc/vorc_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,10 @@ bool OrcReader::_check_expr_can_push_down(const VExprSPtr& expr) {
case TExprOpcode::NE:
case TExprOpcode::FILTER_IN:
case TExprOpcode::FILTER_NOT_IN:
return _check_slot_can_push_down(expr) && _check_rest_children_can_push_down(expr);
// can't push down if expr is null aware predicate
return expr->node_type() != TExprNodeType::NULL_AWARE_BINARY_PRED &&
expr->node_type() != TExprNodeType::NULL_AWARE_IN_PRED &&
_check_slot_can_push_down(expr) && _check_rest_children_can_push_down(expr);

case TExprOpcode::INVALID_OPCODE:
if (expr->node_type() == TExprNodeType::FUNCTION_CALL) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,25 @@ create table type_changed_table (
) stored as orc;
insert into type_changed_table values (1, 'Alice'), (2, 'Bob'), (3, 'Charlie');
ALTER TABLE type_changed_table CHANGE COLUMN id id STRING;

CREATE TABLE table_a (
id INT,
age INT
) STORED AS ORC;

INSERT INTO table_a VALUES
(1, null),
(2, 18),
(3, null),
(4, 25);

CREATE TABLE table_b (
id INT,
age INT
) STORED AS ORC;

INSERT INTO table_b VALUES
(1, null),
(2, null),
(3, 1000000),
(4, 100);
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
-- !predicate_changed_type3 --
3 Charlie

-- !predicate_null_aware_equal_in_rt --
1 \N 1 \N
3 \N 1 \N

-- !predicate_fixed_char1 --
1 a

Expand All @@ -27,3 +31,7 @@
-- !predicate_changed_type3 --
3 Charlie

-- !predicate_null_aware_equal_in_rt --
1 \N 1 \N
3 \N 1 \N

Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ suite("test_hive_orc_predicate", "p0,external,hive,external_docker,external_dock
qt_predicate_changed_type2 """ select * from type_changed_table where id = '2';"""
qt_predicate_changed_type3 """ select * from type_changed_table where id = '3';"""

qt_predicate_null_aware_equal_in_rt """select * from table_a inner join table_b on table_a.age <=> table_b.age and table_b.id in (1,3);"""

sql """drop catalog if exists ${catalog_name}"""
} finally {
}
Expand Down
Loading