Scripts to process missing redeliveries for TikTok

## Parse and compare missing redeliveries
The first script `parse-and-compare.js` is designed to parse a CSV file containing TikTok missing redelivery data 
and CSV with success deliveries from DELIVERY_HISTORY table, and compare them. Resulting list will be items of SR IDs marked 
as successfully delivered in DELIVERY_HISTORY but missing in TikTok missing redelivery report.

First, you need to get list of success deliveries from DELIVERY_HISTORY table. You can use the following SQL query to get the data:

```sql
SELECT 
    osr.isrc,
    srdh.sound_recording_id
FROM 
    FACTS.PROD.ORCHARD_SOUND_RECORDING_DELIVERY_HISTORY srdh
INNER JOIN
    FACTS.PROD.ORCHARD_SOUND_RECORDING osr
ON
    srdh.sound_recording_id = osr.id
WHERE 
    service = 'TikTok (Audio Fingerprinting)'
    and event_type = 'success'
    and execution_type = 'FULL_DELIVERY'
ORDER BY timestamp ASC;
```
and save it to the CSV file `delivered_list.csv` and remove the header row. TikTok file save under the name `tt_list.csv` and also remove headers.

Then, run the script with the following command:

```bash
node parse-and-compare.js
``` 

The result will be saved in `result.csv` file. If the file is too big, you can `split-result.js` script to split it into smaller files.
See the next step.

## Split result into smaller files
The second script `split-result.js` is designed to split a large CSV file into smaller files with a specified number of rows.
To specify the number of rows per file, you can set the `rowsPerFile` variable in the script. By default it is set to 220000.

Run the script with the following command:

```bash
node split-result.js
```

The resulting smaller files will be saved in the same directory with names like `result_part_1.csv`, `result_part_2.csv`, etc.
