Help with Java code - Dropping columns

This is not python related, but if anyone knows java, please look into it.

So here the number of rows are close to 250000, and I am trying to drop the columns that have null values
greater than 100000. There are a lot of columns with mostly null values, but there are also columns
in which null values are less or 0. But this code drops all columns. Can anyone tell whats wrong with
this code?

    String[] columns = loan.columns();
    
    for(String column: columns) {
        
        if(loan.select(col(column).isNull()).count() > 100000) {
            
            loan = loan.drop(col(column));
            
        }
        
    }
    
    System.out.println("Number of columns after dropping columns: " + loan.columns().length);
    loan.show();