How can you create a window function in PySpark to calculate a running total?
Asked in the technical interview stage. For this SQL exercise, write the PostgreSQL equivalent using the provided transaction data.
account_id, transaction_date, transaction_id, amount, and running_total.account_id, transaction_date, and transaction_id.| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| account_id | VARCHAR(20) | Account associated with the transaction |
| transaction_date | DATE | Date on which the transaction occurred |
| amount | DECIMAL(12,2) | Transaction amount, which may be missing |