summaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/join/prune_keys_YQL-19979.yql
blob: 0b93ada1906ebbfcaaab8f298785484952a9e606 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
pragma config.flags('OptimizerFlags', 'EmitPruneKeys');

$a = select * from as_table([
	    <|x:1, t:1|>,
	    <|x:1, t:1|>,
	    <|x:1, t:2|>,
	    <|x:3, t:1|>,
	    <|x:3, t:4|>,
	    <|x:3, t:2|>,
	]);

$b = select * from as_table([
	    <|x:1, y:1|>,
	    <|x:1, y:2|>,
	    <|x:1, y:3|>,
	    <|x:1, y:3|>,
	    <|x:2, y:3|>,
	    <|x:2, y:4|>,
	]);

$distinct_a = (select distinct * from $a);
select a.x from any $distinct_a as a join any $b as b on a.x == b.y;