Rewrite plans with Apply/Optional/Expand to use OptionalExpand instead.
Merge pull request #3305 from pontusmelke/unnest-optional

[2.2] Rewrite plans with Apply/Optional/Expand to use OptionalExpand instead.