Read queries from a text file (audit.txt with userid, timestamp, tablename, query text) and give the maximum queried user, in Python and Spark
Asked in the Technical Round 2 stage. For this SQL exercise, use the audit log table as the source.
userid and query_count.userid ascending.| Column | Type | Description |
|---|---|---|
| audit_idPK | INTEGER | Unique audit record identifier |
| userid | INTEGER | Identifier of the user who issued the query |
| query_timestamp | TIMESTAMPTZ | Timestamp when the query was issued |
| tablename | VARCHAR(100) | Table referenced by the query |
| query_text | TEXT | SQL text recorded in the audit log |