Forward port of Mario's PySpark PRs #19
                
     Merged
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
This PR is a forward port of (parts of) duckdb/duckdb#15462 and duckdb/duckdb#15036 by @mariotaddeucci with a couple of omissions after a careful review:
explode()is mapped to unnest but that has significantly different semantics:explode()on a map creates two new columnskeyandvalue<->unnest()creates new columns for each key.explode()on a list creates a new columncol<->unnest()creates a column named "unnest()". This is probably fixable thoughcount_if()is problematic (andcount()is as well). The examples in the docstring don't work and right now can't work, afaict, becauseselectcreates a projection and for some reason we can't aggregate on that (e.g. this throws an error:df.select(sf.count('b'), sf.count_if('b')).show()). Before we put this in we'd need to figure out a way to fix that, otherwise the semantics aren't even close to those of Spark.every()suffers from the same problem. E.g. this example from the docstring throws the same exception:spark.createDataFrame([[False], [False], [False]], ["flag"]).select(sf.every("flag")).