Hacker Newsnew | past | comments | ask | show | jobs | submit | kohv's commentslogin

1. Write an SQL query to retrieve entities. Join the multi-row relational tables to the primary entity using a JSON aggregation function. This ensures all related data remains on a single row.

2. Export the query results to a .csv file(s).

3. Utilize Go along with the encoding/csv package to process each CSV row. Construct an in-memory index mapping each entity ID to its byte offset within the CSV file.

4. Traverse the CSV again, using the index to quickly locate and read corresponding lines into in-memory structures. Convert the aggregated JSON columns to standard arrays or objects.

5. After comparing individual CSV rows, save the outcomes to a map. This map associates each entityID with metadata about columns that don't match.

6. Convert the mismatch map into JSON format for further processing or segmentation.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: