Description
Similar to ListQuery, Exists should not be evaluated in Join operator too. Otherwise, a query like following will fail:
sql("select * from l, r where l.a = r.c + 1 AND (exists (select * from r) OR l.a = r.c)")
For the Exists subquery without correlated reference, this patch converts it to scalar subquery with a count Aggregate operator.