>>> df.show()
+---+----+------------+
| id|num1|     numbers|
+---+----+------------+
|  1| 100|[12, 23, 45]|
|  2| 200|        [67]|
|  3| 300|        [12]|
|  4| 400|    [98, 54]|
+---+----+------------+

PySpark code

>>> df.select(F.array_append(F.col("numbers"), F.array_max(F.col("numbers"))).alias("numbers_plus_max")).show()
+------------------+
|numbers_plus_max  |
+------------------+
|[12, 23, 45, 45]  |
|[67, 67]          |
|[12, 12]          |
|[98, 54, 98]      |
+------------------+

teradatamlspk code

# Find max of array
>>> temp_df = df.withColumn("max_number", F.array_max(df.numbers))

#  Append the max value to the original array
>>> temp_df.select(F.array_append(F.col("numbers"), F.col("max_number")).alias("numbers_plus_max")).show()
+----------------+
|numbers_plus_max|
+----------------+
|         (12,12)|
|      (98,54,98)|
|         (67,67)|
|   (12,23,45,45)|
+----------------+
