zhengruifeng commented on code in PR #53117:
URL: https://github.com/apache/spark/pull/53117#discussion_r2540573547
##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -26139,6 +26139,33 @@ def st_geomfromwkb(wkb: "ColumnOrName") -> Column:
return _invoke_function_over_columns("st_geomfromwkb", wkb)
+@_try_remote_functions
+def st_setsrid(geo: "ColumnOrName", srid: "ColumnOrName") -> Column:
+ """Returns a new GEOGRAPHY or GEOMETRY value whose SRID is the specified
SRID value.
+
+ .. versionadded:: 4.1.0
+
+ Parameters
+ ----------
+ geo : :class:`~pyspark.sql.Column` or str
+ A geospatial value, either a GEOGRAPHY or a GEOMETRY.
+ srid : :class:`~pyspark.sql.Column` or str
+ An INTEGER representing the new SRID of the geospatial value.
+
+ Examples
+ --------
+ >>> from pyspark.sql import functions as sf
+ >>> df =
spark.createDataFrame([(bytes.fromhex('0101000000000000000000F03F0000000000000040'),)],
['wkb']) # noqa
+ >>> df.select(sf.st_srid(sf.st_setsrid(sf.st_geogfromwkb('wkb'),
4326)).alias('result')).collect() # noqa
+ [Row(result=4326)]
+ >>> from pyspark.sql import functions as sf
Review Comment:
then lets split the two examples with explanations: `Example 1: xxx` and
`Example 2: xxx`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]