Skip to content

Conversation

@seawinde
Copy link
Contributor

Proposed changes

Support rewrite by materialized view when join has other join conjuncts
Such as mv def is

            select l_orderkey, o_orderdate
            from
            lineitem
            inner join
            orders on l_orderkey = o_orderkey and l_shipdate <= o_orderdate
            inner join partsupp on ps_partkey = l_partkey and l_orderkey + o_orderkey != ps_availqty;

The query can be rewtritten by mv sucessfully when has not equal conjuncts in join
l_shipdate <= o_orderdate and ps_partkey = l_partkey and l_orderkey + o_orderkey != ps_availqty;

            select l_orderkey, o_orderdate
            from
            lineitem
            inner join
            orders on l_orderkey = o_orderkey and l_shipdate <= o_orderdate
            inner join partsupp on ps_partkey = l_partkey and l_orderkey + o_orderkey != ps_availqty;

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@seawinde
Copy link
Contributor Author

run buildall

3 similar comments
@seawinde
Copy link
Contributor Author

run buildall

@seawinde
Copy link
Contributor Author

run buildall

@seawinde
Copy link
Contributor Author

run buildall

Copy link
Contributor

@zfr9527 zfr9527 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Can the two "on" conditions exchange positions?
  2. Can complex expressions be used?
  3. If different tables have the same column names, is it still correct?
  4. Case sensitivity of table/column names.
  5. Can aggregate functions be used?
  6. Does it support full build or partition build?
  7. Combinations of different join types.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@seawinde seawinde force-pushed the support_other_conjuncts_in_join branch from 9e0b44a to b9b70b3 Compare October 24, 2024 09:55
@seawinde
Copy link
Contributor Author

run buildall

@seawinde
Copy link
Contributor Author

run buildall

morrySnow
morrySnow previously approved these changes Oct 28, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Oct 28, 2024
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@seawinde
Copy link
Contributor Author

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Oct 28, 2024
@seawinde
Copy link
Contributor Author

run buildall

Copy link
Contributor

@zfr9527 zfr9527 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

morrySnow
morrySnow previously approved these changes Oct 31, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Oct 31, 2024
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@seawinde
Copy link
Contributor Author

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Oct 31, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 6, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2024

PR approved by at least one committer and no changes requested.

@morrySnow morrySnow merged commit 6fdc8a5 into apache:master Nov 6, 2024
github-actions bot pushed a commit that referenced this pull request Nov 6, 2024
…s other join conjuncts (#41674)

Support rewrite by materialized view when join has other join conjuncts
Such as mv def is

            select l_orderkey, o_orderdate
            from
            lineitem
            inner join
            orders on l_orderkey = o_orderkey and l_shipdate <= o_orderdate
            inner join partsupp on ps_partkey = l_partkey and l_orderkey + o_orderkey != ps_availqty;


The query can be rewtritten by mv sucessfully when has not equal
conjuncts in join
l_shipdate <= o_orderdate` and `ps_partkey = l_partkey and l_orderkey + o_orderkey != ps_availqty;


            select l_orderkey, o_orderdate
            from
            lineitem
            inner join
            orders on l_orderkey = o_orderkey and l_shipdate <= o_orderdate
            inner join partsupp on ps_partkey = l_partkey and l_orderkey + o_orderkey != ps_availqty;
seawinde added a commit to seawinde/doris that referenced this pull request Nov 19, 2024
…s other join conjuncts (apache#41674)

Support rewrite by materialized view when join has other join conjuncts
Such as mv def is

            select l_orderkey, o_orderdate
            from
            lineitem
            inner join
            orders on l_orderkey = o_orderkey and l_shipdate <= o_orderdate
            inner join partsupp on ps_partkey = l_partkey and l_orderkey + o_orderkey != ps_availqty;


The query can be rewtritten by mv sucessfully when has not equal
conjuncts in join
l_shipdate <= o_orderdate` and `ps_partkey = l_partkey and l_orderkey + o_orderkey != ps_availqty;


            select l_orderkey, o_orderdate
            from
            lineitem
            inner join
            orders on l_orderkey = o_orderkey and l_shipdate <= o_orderdate
            inner join partsupp on ps_partkey = l_partkey and l_orderkey + o_orderkey != ps_availqty;
morrySnow pushed a commit that referenced this pull request Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/3.0.3-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants