GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [SQL] Two dead recursive LOCAL views get the same persistent id: DeadCode leaves empty nested circuits · Issue #7946 · feldera/feldera

[SQL] Two dead recursive LOCAL views get the same persistent id: DeadCode leaves empty nested circuits #7946

New issue
Copy link
New issue
Copy link
Open
Open
[SQL] Two dead recursive LOCAL views get the same persistent id: DeadCode leaves empty nested circuits#7946
Copy link
Assignees
mihaibudiu
Labels
SQL compilerRelated to the SQL compilerRelated to the SQL compiler

Description

@anandbraman
anandbraman
opened on Nov 12, 2026
Issue body actions

Summary

When two or more recursive LOCAL views become dead during optimization, compilation fails with:

Operators nested_176 {
    0 operators...
} and nested_177 {
    0 operators...
} have the same persistent id e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

e3b0c442...b855 is the SHA-256 of the empty string. Both operators are recursive circuits that have no operators.

Seen in a user program on v0.381.0. It also reproduces on a main build from 2026-11-10 (89fc01f).

Minimal repro

CREATE TABLE t(src BIGINT, dst BIGINT);

DECLARE RECURSIVE VIEW p1(src BIGINT, dst BIGINT);
CREATE LOCAL VIEW p1 AS SELECT src, dst FROM t UNION SELECT p1.src, t.dst FROM p1 JOIN t ON t.src = p1.dst;

DECLARE RECURSIVE VIEW p2(src BIGINT, dst BIGINT);
CREATE LOCAL VIEW p2 AS SELECT src, dst FROM t UNION SELECT p2.src, t.dst FROM p2 JOIN t ON t.src = p2.dst;

-- Always empty
CREATE LOCAL VIEW empty_left AS
SELECT CAST(NULL AS BIGINT) AS id FROM (VALUES (1)) AS one(x) WHERE FALSE;

CREATE MATERIALIZED VIEW o AS
SELECT l.id, r.dst FROM empty_left AS l LEFT JOIN p1 AS r ON l.id = r.src
UNION ALL
SELECT l.id, r.dst FROM empty_left AS l LEFT JOIN p2 AS r ON l.id = r.src
UNION ALL
SELECT src, dst FROM t;

Compiled with the pipeline-manager flags (-i -je --alltables --ignoreOrder --crates <name> --enterprise).

An even smaller program gives the same error: two recursive LOCAL views that no view reads, plus any materialized view.

Variant Result
As above Error
CREATE VIEW p1/p2 instead of CREATE LOCAL VIEW Compiles
Only one dead recursive LOCAL view Compiles, but emits an empty circuit.recursive(|..| Ok(((),))) crate named operator_e3b0c44298fc1c14

Cause

Step What happens Code
1 empty_left LEFT JOIN p1 becomes an empty stream. Nothing reads p1 any more. PropagateEmptySources.java:383
2 FindDeadCode starts only from sinks. A LOCAL view has no sink, so no operator inside the recursive circuit is kept. A non-LOCAL view has a sink, so it never goes dead. FindDeadCode.java:134
3 RemoveOperators removes the simple operators inside the circuit, but it has no case for DBSPNestedOperator. CircuitCloneVisitor always rebuilds the nested shell, so a circuit with 0 operators remains. RemoveOperators.java:49, CircuitCloneVisitor.java:615
4 MerkleOuter builds the hash of a recursive circuit only from the hashes of its operators. An empty circuit hashes to sha256(""). MerkleOuter.java:145-159
5 CheckPersistentIds finds two operators with that id. Its empty-id check finds only an empty string, not the hash of an empty string. CheckPersistentIds.java:55, :67

In the user program, 9 of 12 recursive LOCAL views went dead this way. Each one was read only through a LEFT JOIN whose left side was a ... FROM (VALUES (1)) WHERE FALSE view.

Possible fix

FindDeadCode already keeps a nested operator when one of its outputs is reachable (FindDeadCode.java:112). RemoveOperators could drop a DBSPNestedOperator that is not in keep. As a guard, CheckPersistentIds could reject a nested operator with no operators.

Workaround

Declare the recursive views with CREATE VIEW instead of CREATE LOCAL VIEW. This fixed the user program.

Activity

  1. anandbraman
    assigned
    mihaibudiu
    on Nov 12, 2026
  2. anandbraman
    added
    SQL compilerRelated to the SQL compilerRelated to the SQL compiler
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @mihaibudiu
    mihaibudiu

Labels

SQL compilerRelated to the SQL compilerRelated to the SQL compiler

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.