DataFrame a
DataFrame b = contains column x,y,a
DataFrame b
a.join(b,
Spark SQL provides a group of methods on Column marked as java_expr_ops which are designed for Java interoperability. It includes and (see also or) method which can be used here:
Column
java_expr_ops
a.col("x").equalTo(b.col("x")).and(a.col("y").equalTo(b.col("y"))