@@ -170,4 +170,76 @@ class GlutenClickHouseJoinSuite extends GlutenClickHouseWholeStageTransformerSui
170170 }
171171 }
172172
173+ test(" GLUTEN-10961 cross join with empty join clause" ) {
174+ val crossSql1 =
175+ """
176+ |select a, b from (select id as a from range(1) )
177+ |cross join (
178+ | select id as b from range(2)
179+ |);
180+ |""" .stripMargin
181+ compareResultsAgainstVanillaSpark(crossSql1, true , { _ => })
182+
183+ val crossSql2 =
184+ """
185+ |select a, b from (select id as a from range(1) where id > 1 )
186+ |cross join (
187+ | select id as b from range(2)
188+ |);
189+ |""" .stripMargin
190+ compareResultsAgainstVanillaSpark(crossSql2, true , { _ => })
191+
192+ val fullSql1 =
193+ """
194+ |select a, b from (select id as a from range(1) where id > 1)
195+ |full join (
196+ | select id as b from range(2)
197+ |)
198+ |""" .stripMargin
199+ compareResultsAgainstVanillaSpark(fullSql1, true , { _ => })
200+
201+ val fullSql2 =
202+ """
203+ |select a, b from (select id as a from range(1) )
204+ |full join (
205+ | select id as b from range(2)
206+ |)
207+ |""" .stripMargin
208+ compareResultsAgainstVanillaSpark(fullSql2, true , { _ => })
209+
210+ val innerSql1 =
211+ """
212+ |select a, b from (select id as a from range(1) where id > 1)
213+ |inner join (
214+ | select id as b from range(2)
215+ |)
216+ |""" .stripMargin
217+ compareResultsAgainstVanillaSpark(innerSql1, true , { _ => })
218+ val innerSql2 =
219+ """
220+ |select a, b from (select id as a from range(1) )
221+ |inner join (
222+ | select id as b from range(2)
223+ |)
224+ |""" .stripMargin
225+ compareResultsAgainstVanillaSpark(innerSql2, true , { _ => })
226+
227+ val leftSql1 =
228+ """
229+ |select a, b from (select id as a from range(1) where id > 1)
230+ |left join (
231+ | select id as b from range(2)
232+ |)
233+ |""" .stripMargin
234+ compareResultsAgainstVanillaSpark(leftSql1, true , { _ => })
235+ val leftSql2 =
236+ """
237+ |select a, b from (select id as a from range(1) )
238+ |left join (
239+ | select id as b from range(2)
240+ |)
241+ |""" .stripMargin
242+ compareResultsAgainstVanillaSpark(leftSql2, true , { _ => })
243+ }
244+
173245}
0 commit comments