'create unique runid and append in output dataframe for each time we run spark scala code

create unique runid and append in output dataframe for each time we run spark scala code

Below is my Output dataframe i want to add 1 more column for runid , can anyone help?

+--------+-------------------------------+---+
|order_id|Diff                           |id |
+--------+-------------------------------+---+
|12      |order_status                   |1  |
|1       |order_customer_id order_status |1  |
|68885   |New row in DataFrame 2         |1  |
|68886   |New row in DataFrame 2         |1  |
|2       |order_customer_id              |1  |
|12      |order_status                   |2  |
|1       |order_customer_id order_status |2  |
|68885   |New row in DataFrame 2         |2  |
|68886   |New row in DataFrame 2         |2  |
|2       |order_customer_id              |2  |
+--------+-------------------------------+---+


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source