Fixed the bug that all columns for cached tables get pruned in lateral view (and as a result returning nulls for everything).

(cherry picked from commit a696fe9e66922747bf7bee2cb342c33a0986da54)
Signed-off-by: Reynold Xin <rxin@apache.org>