[ 
https://issues.apache.org/jira/browse/CALCITE-7111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18010388#comment-18010388
 ] 

Stamatis Zampetakis commented on CALCITE-7111:
----------------------------------------------

The "Suggester" naming suffix is inspired from the 
[LatticeSuggester|https://github.com/apache/calcite/blob/3719447e125982aaa47f0a7b2564f94b9900539e/core/src/main/java/org/apache/calcite/materialize/LatticeSuggester.java],
 which could potentially become one possible implementation of this interface. 
I don't feel strongly about the exact name so if there other thoughts/ideas I 
am fine to go with the majority.

> Add an API for finding common relational sub-expressions
> --------------------------------------------------------
>
>                 Key: CALCITE-7111
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7111
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Major
>
> There have been various tickets (CALCITE-5631) and 
> [discussions|https://lists.apache.org/thread/oj7kzz39n4jn0jj7vgflzwl5xr65s3h5]
>  touching the problem of optimizing queries with common sub-expressions. A 
> recurrent need is given a query/plan/RelNode to identify common 
> sub-expressions and for that purpose multiple algorithms can be developed 
> with different trade-offs. Someone may opt to implement a complex algorithm 
> from a research paper based on integer linear programming (ILP) while another 
> one may simply go for a structure based traversal.
> The goal of this ticket is to introduce a simple interface that given a 
> RelNode finds/detects/suggests common sub-expressions.
> {code:java}
>  
> @API(since = "1.41.0", status = API.Status.EXPERIMENTAL)
> public interface RelCommonExpressionSuggester {
>   Collection<RelNode> suggest(RelNode input, Context context);
> }
> {code}
> The interface and its Javadoc will go along with a simple implementation 
> detecting exact matches and some tests.
> The main motivation behind this proposal comes from Apache Hive and Apache 
> Impala that aim to exploit common sub-expressions during planning. Instead of 
> crafting separate interfaces for each project or copy-pasting code around it 
> is natural to have the basic interfaces in calcite-core. Moreover, this 
> proposal allows closed source implementations of the interface to be used in 
> each project without ending up with contrived cyclic dependencies.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to