pyspark.sql.functions.
overlay
Overlay the specified portion of src with replace, starting from byte position pos of src and proceeding for len bytes.
New in version 3.0.0.
Examples
>>> df = spark.createDataFrame([("SPARK_SQL", "CORE")], ("x", "y")) >>> df.select(overlay("x", "y", 7).alias("overlayed")).show() +----------+ | overlayed| +----------+ |SPARK_CORE| +----------+