#24807·duckdb

Dict-surviving hash join InternalException on a RIGHT join whose build is a nested-loop of two identity hash joins

Author: wanteatfruitCreated Aug 16, 2026Updated Sep 29, 2026
Labelsreproduced

What happens?

The following queries raised an internal error

INTERNAL Error: dict-surviving join: narrowed column 3 received a non-global-dictionary chunk; build pipeline is not single-source

To Reproduce

sql
CREATE TABLE t__base (
  c_pk BIGINT NOT NULL,
  c_int BIGINT,
  c_big DECIMAL(38, 0),
  c_txt VARCHAR,
  c_date DATE,
  c_ts TIMESTAMP
);
INSERT INTO t__base VALUES (3, NULL, -7, NULL, DATE '2030-06-01', NULL);
INSERT INTO t__base VALUES (8, -1, 1, 'x', DATE '2024-01-15', TIMESTAMP '1999-12-31 23:59:59');
CREATE TABLE t25 AS SELECT c_pk, 1 AS flag FROM t__base;
CREATE VIEW t AS
SELECT l.c_pk AS c_pk, l.c_int AS c_int, l.c_big AS c_big,
       l.c_txt AS c_txt, l.c_date AS c_date, l.c_ts AS c_ts
FROM t__base l
INNER JOIN t25 r ON l.c_pk = r.c_pk
WHERE r.flag = 1;

SELECT t3.c_txt, t3.c_big
FROM t t1
RIGHT OUTER JOIN t t2 ON t1.c_int <= t2.c_int
LEFT OUTER JOIN t t3 ON t1.c_date = t3.c_ts;
-- INTERNAL Error: dict-surviving join: narrowed column 3 received a
-- non-global-dictionary chunk; build pipeline is not single-source

However, without creating the view, this is correct:

sql
CREATE TABLE t (
  c_pk BIGINT NOT NULL,
  c_int BIGINT,
  c_big DECIMAL(38, 0),
  c_txt VARCHAR,
  c_date DATE,
  c_ts TIMESTAMP
);
INSERT INTO t VALUES (3, NULL, -7, NULL, DATE '2030-06-01', NULL);
INSERT INTO t VALUES (8, -1, 1, 'x', DATE '2024-01-15', TIMESTAMP '1999-12-31 23:59:59');

SELECT t3.c_txt, t3.c_big
FROM t t1
RIGHT OUTER JOIN t t2 ON t1.c_int <= t2.c_int
LEFT OUTER JOIN t t3 ON t1.c_date = t3.c_ts;
-- Expected 2 rows (NULL, NULL). Actual 2 rows (NULL, NULL).

OS:

macOS

DuckDB Version:

v2.0.0-alpha37826 (a9f869b6a7)

DuckDB Client:

CLI

Hardware:

No response

Full Name:

Junwen An

Affiliation:

NUS

Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?

  • Yes, I have

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant data sets for reproducing the issue?

Yes