0

Currently I have a table that saves data quality results (using Dataplex), in this table it leaves me a query to see the data that does not meet the quality rule. Example:

table

In order to know which fields do not comply with the rule defined in Data Quality, I must execute that query. How can I read that field, execute the query and save the data in a table to view in looker?

I was thinking about cloud function, but should I make one for each table?

1
  • What you are showing is a SQL query that, when executed, shows all the rows that failed the query. I think you mean to say "I want to know which ROWS" do not comply rather than which fields do not comply. Consider using cloud.google.com/bigquery/docs/reference/standard-sql/… to run a query using the SQL resulting from Dataplex as input. Commented Jun 19, 2024 at 22:03

1 Answer 1

0

You have multiple way to achieve it, but you must use a procedural language.

Indeed, you can use Cloud Functions, or Cloud Run, to run a first query to get all the query-strings, and then iterate over this list to execute each query one by one (be careful to the timeout if you have long and/or many queries. If you are in this case, drop a comment, I will explain you how to scale out).

The other option is to use procedural language in BigQuery. Same as before, perform a first query to get the query-strings, iterate over this list and use the execute immediate operation to run a query from a string. In that case, you won't be able to scale out easily, and the SQL procedural language is much more unfamiliar and difficult to read/write/debug/improve.


In both cases, if you need to store the output in a table to reuse the result in dataviz tool, you have to wrap your query-string in a "INSERT INTO .... " query.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.