leanmind logo leanmind text logo

Blog

Advanced TDD

The tools you need to apply TDD in the real world on any project.

Maintainable Failed Rows SQL Queries for soda.io

By Mario S. Pinto Miranda

In this article, we saw the importance of having good data quality, and how to use soda.io to monitor it, covering the checks by a concrete unit testing strategy. Among the possible checks, we saw the possibility of checking the failed rows of a table. In this article we will see how to refactor the SQL queries to make them more maintainable with a pattern where we will be able to see different parts of the query in a more clear way (building, errorsRows and reportedRows).

The problem

The failed rows check, in short, is a query that returns the rows that meet a fail condition. For example, if we have a table where start date is later than end date, we can check the rows that meet this condition with the following query:

Continue reading…


Source: https://www.mario-pinto-miranda.dev/blog/maintainable-failed-row-sql-query-in-soda
Published on 2023/11/09 by

Do you want more? We invite you to subscribe to our newsletter to get the most relevan articles.

If you enjoy reading our blog, could you imagine how much fun it would be to work with us? let's do it!

We boost the professional growth of your development team