hi team, wondered if the acutal result of test_qu...
# community-support
w
hi team, wondered if the acutal result of test_query_result (the compiled query) gets stored somewhere in the elementary database? so that i can parse that and insert it into the slack alert message. Thank you!
✅ 1
e
Hi @Wenlu you can use the
test_results_query
in the
elementary_test_results
table. How were you planning to insert it into the slack alert?
w
Thanks @Ella Katz, the
test_results_query
field only contains complied query, however, i’d like to retrieve the query result, than only count of failure. Do elementary store the acutal result somewhere?
e
Just to make sure I understand correctly- Do you need the query result that returns the failed rows? for example, if the test is
not_null
, do you need the query that returns all the rows with nulls? Also, just pointing out, we already include a result sample in our alerts 🙂
w
yes @Ella Katz, the result that returns the failed rows - hoping to get the distinct values in the alert. Do we store this somehwere in elementary database? yea the elementary alert unfortunately didn’t work out for us, we had to go with parsing the results ourselves and send alerts.
a
Hey @Wenlu Elementary stores the sample of failed rows in a table called
test_results_samples / test_result_rows
, unless you disable it with
test_sample_row_count: 0
. You can also use dbt native feature. https://docs.getdbt.com/reference/resource-configs/store_failures
👍 1
w
Thanks @Alex !! This is really helpful