Skip to content
Merged
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
12 changes: 12 additions & 0 deletions src/backend/executor/nodeHashjoin.c
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,18 @@ CheckTargetNode(PlanState *node, AttrNumber attno, AttrNumber *lattno)
if (!IsA(te->expr, Var))
return false;

if (IsA(node, DynamicSeqScanState))
{
*lattno = te->resno;
return true;
}

/*
* seqscan is a special case, it's targetlist is a projection of the
* relation's attributes. so we need to find the attribute number of the
* column in the relation, because PassByBloomFilter runs before
* projection in seqscan.
*/
var = castNode(Var, te->expr);

/* system column is not allowed */
Expand Down
4 changes: 2 additions & 2 deletions src/test/regress/expected/gp_runtime_filter.out
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ INSERT INTO t2 SELECT generate_series(51, 51), generate_series(51, 51);
ANALYZE;
SET optimizer TO on;
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
SELECT * FROM t1, t2 WHERE t1.c2 = t2.c2;
SELECT t1.c2 FROM t1, t2 WHERE t1.c2 = t2.c2;
QUERY PLAN
-------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3) (actual rows=96 loops=1)
Expand All @@ -567,7 +567,7 @@ SELECT * FROM t1, t2 WHERE t1.c2 = t2.c2;

SET gp_enable_runtime_filter_pushdown TO on;
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
SELECT * FROM t1, t2 WHERE t1.c2 = t2.c2;
SELECT t1.c2 FROM t1, t2 WHERE t1.c2 = t2.c2;
QUERY PLAN
-------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3) (actual rows=96 loops=1)
Expand Down
4 changes: 2 additions & 2 deletions src/test/regress/sql/gp_runtime_filter.sql
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ ANALYZE;
SET optimizer TO on;

EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
SELECT * FROM t1, t2 WHERE t1.c2 = t2.c2;
SELECT t1.c2 FROM t1, t2 WHERE t1.c2 = t2.c2;

SET gp_enable_runtime_filter_pushdown TO on;

EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
SELECT * FROM t1, t2 WHERE t1.c2 = t2.c2;
SELECT t1.c2 FROM t1, t2 WHERE t1.c2 = t2.c2;

RESET gp_enable_runtime_filter_pushdown;

Expand Down
Loading