Github user nsyca commented on the issue:

    https://github.com/apache/spark/pull/17491
  
    @cloud-fan wrote: "How useful is this optimization? It only works when 
Exists has no condition, is that a common case?"
    
    One of the common cases of this usage is an application of ACL where the 
application asks the database whether the user has a proper authority to access 
a certain set of data or not.
    
    Ex:
    
    select ... from controlled_table where exists (select 1 from acl_table 
where user = CURRENT_USER and role = ...)
    
    From a runtime perspective, an optimal access plan is placing the ACL_TABLE 
as an outer of a nested-loop join with a semantic to fetch only the first 
qualified row, once the row exists, continue to process the inner table, 
CONTROLLED_TABLE, or avoiding access the inner completely if no qualified row 
from the outer.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to