I have a lateral join
defined in this way:
select A.id, B.value
from A
left join lateral (
select value
from B
where B.id = A.id
limit 1
) as X on true;
that has the particular point of having limit 1
inside (in more complicated cased I could have some extra option in the join to narrow down the values and/or an order by
). I know that in Spark-SQL there is nothing like that at the moment, so how can I get a workaround for it?
lateral
can be replaced with ajoin
+group by
: Link. It depends on the actual task to say what the best solution in Spark would be. – Olivann