org.apache.spark.sql.sedona_sql.expressions.st_functions, org.apache.spark.sql.sedona_sql.expressions.st_constructors, org.apache.spark.sql.sedona_sql.expressions.st_predicates, and org.apache.spark.sql.sedona_sql.expressions.st_aggregates.
Every function can take all Column arguments. Additionally, overloaded forms can commonly take a mix of String and other Scala types (such as Double) as arguments.
In general the following rules apply (although check the documentation of specific functions for any exceptions):
- Python
- Scala
Columntype arguments are passed straight through and are always accepted.strtype arguments are always assumed to be names of columns and are wrapped in aColumnto support that. If an actual string literal needs to be passed then it will need to be wrapped in aColumnusingpyspark.sql.functions.lit.- Any other types of arguments are checked on a per function basis. Generally, arguments that could reasonably support a python native type are accepted and passed through.
- Shapely
Geometryobjects are not currently accepted in any of the functions.
String arguments are assumed to be the names of columns and will be wrapped in a Column automatically.
Non-String arguments are assumed to be literals that are passed to the sedona function. If you need to pass a String literal then you should use the all Column form of the sedona function and wrap the String literal in a Column with the lit Spark function.
A short example of using this API (uses the array_min and array_max Spark functions):
- Python
- Scala

