1# Returns the cartesian product with another DataFrame
2
3df.select("age", "name").collect()
4# [Row(age=2, name='Alice'), Row(age=5, name='Bob')]
5df2.select("name", "height").collect()
6# [Row(name='Tom', height=80), Row(name='Bob', height=85)]
7df.crossJoin(df2.select("height")).select(
8 "age", "name", "height").collect()
9# [Row(age=2, name='Alice', height=80), Row(age=2, name='Alice', height=85), Row(age=55, name='Bob', height=80), Row(age=5, name='Bob', height=85)]