Implement JOIN ... LATERAL and JOIN ... UNNEST.