Skip to content

[SQL] Views with equivalent self joins on table fail with compilation error when run together in the same pipeline #5858

@rivudhk

Description

@rivudhk

Following SQL:

CREATE TABLE purchase (
ts TIMESTAMP NOT NULL LATENESS INTERVAL 1 HOUR,
amount BIGINT
) WITH (
'append_only' = 'true'
);


CREATE MATERIALIZED VIEW v1
WITH ('emit_final' = 'a_ts')
AS
SELECT
a.ts AS a_ts,
a.amount + b.amount AS total
FROM purchase a
JOIN purchase b
ON a.ts = b.ts;

CREATE MATERIALIZED VIEW v2
WITH ('emit_final' = 'a_ts')
AS
SELECT
a.ts AS a_ts,
a.amount + b.amount AS total
FROM purchase a
JOIN purchase b
ON a.ts = b.ts + INTERVAL '0' SECOND;

Fails with the following error:

COMPILE-TIME ERROR:
Pipeline local_lateness_tests_1138a315 failed to compile:
This is a bug in the compiler (please report it to the developers)
Key 'IntegrateTraceRetainKeys 180' does not exist in map

Metadata

Metadata

Assignees

Labels

SQL compilerRelated to the SQL compiler

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions