Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InternalServerError: materialized set was not finalized! After a big query + Group + bulk Insert #7320

Open
monsieurpigeon opened this issue May 8, 2024 · 0 comments

Comments

@monsieurpigeon
Copy link

monsieurpigeon commented May 8, 2024

  • EdgeDB Version: 5.2+93e890a
  • EdgeDB CLI Version: 5.0.0+c9dfeec
  • OS Version: MacOS 14.4.1 (23E224)

Steps to Reproduce:

  1. Users add Channels to their .channels, the Channel is created if it does not exist yet

  2. Users click on "Scan" to launch the next query : the point is to find other users with the most matching channels

  3. Both Clone and User tables should be updated with the result of the query

  4. Query

WITH currentUser := (SELECT User FILTER .email = "maxpige@gmail.com"),
    clones := (
        (FOR channel in currentUser.channels
        UNION channel.<channels[is User]) 
    ),
    cloneResult := (GROUP clones BY .email),
    myClones := (SELECT cloneResult {
        element := (SELECT .elements LIMIT 1){
            email,
        },
        cloneCount := count(.elements)
    } FILTER .element.email != currentUser.email
    ORDER BY .cloneCount DESC
    LIMIT 10)

UPDATE User FILTER .email = currentUser.email
SET {
    clones := (FOR clone in myClones UNION (INSERT Clone {
        element := clone.element,
        cloneCount := clone.cloneCount
    }))
}
  1. local UI gives InternalServerError: materialized set was not finalized!

  2. nextjs interface gives Error: Can't find materialized set ns~73@@(__derived__::myClones@w~16)

  3. If I update the last part to ...

SET {
    clones := { }
}

... It runs entirely with a total cost of 7.39

Schema:

type User { 
    email: str;
    multi channels: Channel;
    multi clones: Clone;
}

type Clone {
    cloneCount: int64;
    element: User;
}

type Channel {
    name: str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant