You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Basic unsupported federation of `AS 'non_federate'`. Note filter non_federate > 0 can be
595
+
// pushed down since it will be optimised into `Filter: table_a1.a > Int64(0)`.
596
+
insta::assert_snapshot!(ctx
597
+
.sql(
598
+
r#"SELECT non_federate, b, c FROM (SELECT a AS 'non_federate', b, c FROM table_a1) WHERE non_federate > 0"#,
599
+
)
600
+
.await?
601
+
.into_optimized_plan()?
602
+
.display_indent(), @r"
603
+
Projection: table_a1.a AS non_federate, table_a1.b, table_a1.c
604
+
Federated
605
+
Projection: table_a1.a, table_a1.b, table_a1.c
606
+
Filter: table_a1.a > Int64(0)
607
+
TableScan: table_a1
608
+
");
609
+
610
+
// Basic join of two different context tables.
611
+
insta::assert_snapshot!(ctx
612
+
.sql(
613
+
r#"SELECT b.a, b.b, a.b, a.c FROM table_a1 a JOIN table_b1 b ON a.a=b.a"#,
614
+
)
615
+
.await?
616
+
.into_optimized_plan()?
617
+
.display_indent(), @r"
618
+
Projection: b.a, b.b, a.b, a.c
619
+
Inner Join: a.a = b.a
620
+
Federated
621
+
Projection: a.a, a.b, a.c
622
+
SubqueryAlias: a
623
+
TableScan: table_a1
624
+
Projection: b.a, b.b
625
+
Federated
626
+
Projection: b.a, b.b, b.c
627
+
SubqueryAlias: b
628
+
TableScan: table_b1
629
+
"
630
+
);
631
+
632
+
// Basic join of two same-context tables.
633
+
insta::assert_snapshot!(ctx
634
+
.sql(
635
+
r#"SELECT b.a, b.b, a.b, a.c FROM table_b1 a JOIN table_b2 b ON a.a=b.a"#,
636
+
)
637
+
.await?
638
+
.into_optimized_plan()?
639
+
.display_indent(), @r"
640
+
Federated
641
+
Projection: b.a, b.b, a.b, a.c
642
+
Inner Join: Filter: a.a = b.a
643
+
SubqueryAlias: a
644
+
TableScan: table_b1
645
+
SubqueryAlias: b
646
+
TableScan: table_b2
647
+
"
648
+
);
649
+
650
+
// JOIN ON different contexts, one child has non-federateable [`LogicalPlan`].
651
+
insta::assert_snapshot!(ctx
652
+
.sql(
653
+
r#"SELECT a.*, j.non_federate FROM (SELECT b.a AS a, b.b as 'non_federate', a.b as b, a.c as c FROM table_b1 a JOIN table_b2 b ON a.a=b.a) j JOIN table_a1 a ON j.a = a.a"#,
0 commit comments