Skip to content

Conversation

@feiniaofeiafei
Copy link
Contributor

cherry-pick #37314 to branch-2.1

This pr add pull up literal when infer predicates, we can infer
tmp.col1='abc' and tmp.col2 = 'def' from subquery tmp, pull up to inner
join, and combined with join on condition, we can infer ds.col1='abc'
and ds.col2='def'

select
	*
from
	(
	select
		tmp.col1,
		tmp.col2
	from
		(
		select
			'abc' as col1,
			'def' as col2
		from
			test_pull_up_predicate_literal
               ) tmp
               inner join test_pull_up_predicate_literal ds 
               on tmp.col1 = ds.col1 and tmp.col2 = ds.col2
	) t
where col1 = 'abc' and col2 = 'def';

---------

Co-authored-by: feiniaofeiafei <moailing@selectdb.com>
@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.

@feiniaofeiafei
Copy link
Contributor Author

run buildall

@feiniaofeiafei
Copy link
Contributor Author

run buildall

@morrySnow morrySnow merged commit 43ec98a into apache:branch-2.1 Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants