-
Notifications
You must be signed in to change notification settings - Fork 155
Description
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.