Giter Site home page Giter Site logo

Comments (6)

msullivan avatar msullivan commented on September 27, 2024

Could you provide a definition of Status or tweak it to not use a scalar that's missing? Thanks!

from edgedb.

jollygreenlaser avatar jollygreenlaser commented on September 27, 2024

@msullivan done

from edgedb.

msullivan avatar msullivan commented on September 27, 2024

Thanks! It looks like this is some sort of insane path factoring related bug. Ahhhhhh: because .status is path factored out, it is "visible" from its use in the nested select, which combined with the union as part of the if condition, is causing trouble.

I'm digging into it more, but if you put the reference to .status in the if condition inside a subquery ((select .status) or {.status}) it prevents the issue.

A reduced version is

select C {
  bs := (
    with complete := .status
    select {
      complete := complete,
    }
  ) if .status != 'Private' else {}
};

from edgedb.

jollygreenlaser avatar jollygreenlaser commented on September 27, 2024

Smart. Forgot to mention, I got around it by throwing the if check as a part of the filter on the select. Seems to be mildly faster too.

from edgedb.

msullivan avatar msullivan commented on September 27, 2024

Smart. Forgot to mention, I got around it by throwing the if check as a part of the filter on the select. Seems to be mildly faster too.

Yeah, that is a generally cleaner approach and will typically be faster. FILTER (WHERE in SQL) is a pretty fundamental concept in SQL, and IF is not.

from edgedb.

msullivan avatar msullivan commented on September 27, 2024

Another note: the ability to have an object with a shape in the then clause of an if and and empty set in the else clause and have it preserve the output shape was introduced completely by accident in 4.0. I didn't realize it worked until the issue. Normally an if always loses the output shape.

Arguably it's a bug that it doesn't here.

from edgedb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.