Github user viirya commented on the issue:

    https://github.com/apache/spark/pull/18687
  
    > So far, we do not support dynamic SQL statement, but this is a potential 
feature we can explore in the future. A global statement cache and management 
can reduce the optimization costs, especially when our CBO optimizer is more 
advanced.
    
    I agree. The dynamic statement cache is used to reduce the costly 
preparation process by reusing prepared (parsed, analyzed and optimized) 
statement. IIUC, this only works for identical dynamic SQL statements. When CBO 
optimizer goes more advanced and more costly, the statement cache might help 
reduce the cost for identical statements.
    
    The current cache in SparkSQL is not for statement cache, but for query 
plan fragment (and its execution result) cache. A query doesn't need to be 
identical to cached query plan. It can reuse the cached plan even when the 
cached one is just a fragment of it.
    
    So seems to me they are orthogonal and can be complementary.
    
    
    
    



---
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