Skip to content

Support IN and NOT IN nested inside of expressions in projected fields #153

@glittershark

Description

@glittershark

07ef2a8 added support for IN and NOT IN exprs as the top-level expressions in projected fields, but won't support those exprs if they're nested inside of another more complex expression. A simple example might be something like:

SELECT NOT (x IN (SELECT x FROM t2)) FROM t1

and a more real-world example might be something like:

SELECT CASE WHEN x IN (SELECT x FROM t2) THEN 'found it' ELSE 'not found' END FROM t1

In order to make this work, we'll probably need to rewrite the expressions themselves (using some kind of Visitor, most likely) to reference named columns for those IN exprs, collecting a list of IN exprs to project out using our special IN compilation. Alternatively, it might be worth modifying expr lowering to take a callback for compiling exprs that Project itself can't support, which we can hook into to compile not just IN but all sorts of exprs that need to be compiled as more than one node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CachingCreated by Linear-GitHub Syncfirst-issueCreated by Linear-GitHub Sync

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions