Write a PySpark job to read JSON files from ADLS, apply transformations, and write back as Parquet.
Asked in the technical interview stage. Implement the testable function below as a deterministic job specification for an ADLS path. The job must read JSON, trim record_id and name, cast amount to double and active to boolean, retain active records, remove duplicate record_id values, and overwrite Parquet output.
build_pyspark_job(input_path, output_path) returns a JSON-compatible dictionary describing the read format, write format, mode, output columns, and transformations.
def build_pyspark_job(input_path, output_path):