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):
- Scala
- Python
- Every function returns a
Columnso that it can be used interchangeably with Spark functions as well asDataFramemethods such asDataFrame.selectorDataFrame.join. - Every function has a form that takes all
Columnarguments. These are the most versatile of the forms. - Most functions have a form that takes a mix of
Stringarguments with other Scala types.
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):
- Scala
- Python

