Once https://github.com/apache/spark/pull/25801 is resolved, we can do it in a single pass. Currently, which column has to be executed for whole DataFrame.