How to workaround this case of lateral join with Spark SQL?

Viewed 482

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?

0 Answers
Related