You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Xurenhe (Jira)" <ji...@apache.org> on 2022/04/22 12:23:00 UTC

[jira] [Updated] (CALCITE-5109) RelMdAllPredicates support to analyze left-out-join

     [ https://issues.apache.org/jira/browse/CALCITE-5109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xurenhe updated CALCITE-5109:
-----------------------------
    Description: 
 
{code:java}
select * from
 left_sub_query {left_where_condition}
join {join_type}
 right_sub_query {right_where_condition}
on {on_condition}
where {where_condition}{code}
 

As we know:
 * join_type is {*}left out join{*}:
 ** *left_where_condition* could be pulled to *where_condition*
 ** *right_where_condition* could be pulled to *on_condition*
 * join_type is *right out join:* 
 ** *left_where_condition* could be pulled to *on_condition*
 ** *right_where_condition* could be pulled to *where_condition*

----
There are a large number of star-model in the warehouse. Rewriting query by materialized view is a very effective way to speed up query.
 
I'm expanding [*MaterializedViewRule#perform*|#L175]]to support rewriting query when meeting left-out-join, and found that [*RelMdAllPredicates*|#L193]] didn't support to analyze left-join.
Could calcite support it? This feature is very important for expanding *MaterializedViewRule#perform*
 

  was:
 
{code:java}
select * from
 left_sub_query {left_where_condition}
join {join_type}
 right_sub_query {right_where_condition}
on {on_condition}
where {where_condition}{code}
 

As we know:
 * join_type is {*}left out join{*}:
 ** *left_where_condition* could be pulled to *where_condition*
 ** *right_where_condition* could be pulled to *on_condition*
 * join_type is *right out join:* 
 ** *left_where_condition* could be pulled to *on_condition*
 ** *right_where_condition* could be pulled to *where_condition*

----
There are a large number of star-model in the warehouse. Rewriting query by materialized view is a very effective way to speed up query.
 
I'm expanding [{*}MaterializedViewRule#perform{*}|[https://github.com/apache/calcite/blob/bc23290fe67725282b8e2294723c8a9368f05486/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewRule.java#L175]]to support rewriting query when meeting left-out-join, and [{*}RelMdAllPredicates{*}|[https://github.com/apache/calcite/blob/bc23290fe67725282b8e2294723c8a9368f05486/core/src/main/java/org/apache/calcite/rel/metadata/RelMdAllPredicates.java#L193]] didn't support to analyze left-join now.
Could calcite support it? This feature is very important for expanding *MaterializedViewRule#perform*
 


> RelMdAllPredicates support to analyze left-out-join
> ---------------------------------------------------
>
>                 Key: CALCITE-5109
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5109
>             Project: Calcite
>          Issue Type: Wish
>          Components: core
>            Reporter: Xurenhe
>            Priority: Major
>
>  
> {code:java}
> select * from
>  left_sub_query {left_where_condition}
> join {join_type}
>  right_sub_query {right_where_condition}
> on {on_condition}
> where {where_condition}{code}
>  
> As we know:
>  * join_type is {*}left out join{*}:
>  ** *left_where_condition* could be pulled to *where_condition*
>  ** *right_where_condition* could be pulled to *on_condition*
>  * join_type is *right out join:* 
>  ** *left_where_condition* could be pulled to *on_condition*
>  ** *right_where_condition* could be pulled to *where_condition*
> ----
> There are a large number of star-model in the warehouse. Rewriting query by materialized view is a very effective way to speed up query.
>  
> I'm expanding [*MaterializedViewRule#perform*|#L175]]to support rewriting query when meeting left-out-join, and found that [*RelMdAllPredicates*|#L193]] didn't support to analyze left-join.
> Could calcite support it? This feature is very important for expanding *MaterializedViewRule#perform*
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)