Documentation Index

Fetch the complete documentation index at: https://docs.validatar.com/llms.txt

Use this file to discover all available pages before exploring further.

TEST_EXECUTION_RESULTS (Single-Value Tests)

Prev Next

Overview

RESULTS.TEST_EXECUTION_RESULTS stores the row-level output for single-value tests — tests that compare one scalar value from the test dataset against one scalar value from the control dataset. Examples include row count comparisons, aggregate checks (SUM, AVG, MIN, MAX), and any test where the data set column type is set to produce a single-row result.

Each row in this table represents one comparison within a test execution. Most single-value tests produce exactly one row per execution, but some (like profile-based tests with a coverage flag) may produce multiple rows.

Schema

Column Type Nullable Description
TEST_EXECUTION_ID NUMBER No Links to VW_DATASET_TEST_EXECUTIONS — identifies which execution produced this result
TEST_ID NUMBER No The test ID
TEST_VERSION_ID NUMBER No The test version ID
ROW_INDEX NUMBER No Row position within this execution (usually 1 for single-value tests)
COVERAGE_FLAG NUMBER No Coverage type: 3 = Matched (both source and target returned data)
OVERFLOW_FLAG NUMBER No 0 = normal, 1 = value truncated due to size
COMBINED_KEY VARCHAR Yes Combined key value (usually NULL for single-value tests)
NUMERIC_SOURCE_VALUE DECIMAL(27,8) Yes Numeric value from the test (source) dataset
NUMERIC_TARGET_VALUE DECIMAL(27,8) Yes Numeric value from the control (target) dataset
ACTUAL_DIFFERENCE DECIMAL(27,8) Yes Source minus target
ABSOLUTE_DIFFERENCE DECIMAL(27,8) Yes Absolute value of the difference
PERCENT_DIFFERENCE DECIMAL(18,9) Yes Percentage difference (as a decimal, e.g., 0.05 = 5%)
EVALUATION_RESULT_ID NUMBER Yes Result code: 24 = Passed, 25 = Failed, 26 = Error
EVALUATION_RESULT_NAME VARCHAR(100) Yes "PASSED", "FAILED", or "ERROR"
STRING_SOURCE_VALUE VARCHAR Yes String value from the source (when comparing strings)
STRING_TARGET_VALUE VARCHAR Yes String value from the target
DATE_SOURCE_VALUE VARCHAR Yes Date value from the source (stored as string)
DATE_TARGET_VALUE VARCHAR Yes Date value from the target
SF_DATE_CREATED TIMESTAMP No When this row was loaded into Snowflake
SF_IMPORT_FILENAME VARCHAR(500) Yes Staging file that delivered this row

How Values Are Stored

The table uses three pairs of columns depending on the data type being compared:

Comparison Type Source Column Target Column Difference Columns
Numeric NUMERIC_SOURCE_VALUE NUMERIC_TARGET_VALUE ACTUAL_DIFFERENCE, ABSOLUTE_DIFFERENCE, PERCENT_DIFFERENCE
String STRING_SOURCE_VALUE STRING_TARGET_VALUE (not applicable — pass/fail only)
Date DATE_SOURCE_VALUE DATE_TARGET_VALUE (not applicable — pass/fail only)

For numeric comparisons, the difference columns are pre-calculated. For string and date comparisons, the result is strictly pass/fail based on equality.

Relationships

RESULTS.TEST_EXECUTION_RESULTS
    │
    ├── TEST_EXECUTION_ID → REPOSITORY.VW_DATASET_TEST_EXECUTIONS.TEST_EXECUTION_ID
    ├── TEST_ID → REPOSITORY.VW_DATASET_TESTS.TEST_ID
    └── TEST_VERSION_ID → REPOSITORY.VW_DATASET_TESTS.TEST_VERSION_ID

Example Queries

Get Source/Target/Difference for a Specific Execution

SELECT
    TEST_EXECUTION_ID,
    ROW_INDEX,
    NUMERIC_SOURCE_VALUE,
    NUMERIC_TARGET_VALUE,
    ACTUAL_DIFFERENCE,
    PERCENT_DIFFERENCE,
    EVALUATION_RESULT_NAME
FROM RESULTS.TEST_EXECUTION_RESULTS
WHERE TEST_EXECUTION_ID = 3913133;

Join to Test Executions for Context

SELECT
    te.TEST_NAME,
    te.PROJECT_NAME,
    te.DATE_COMPLETED,
    r.NUMERIC_SOURCE_VALUE AS SOURCE_VALUE,
    r.NUMERIC_TARGET_VALUE AS TARGET_VALUE,
    r.PERCENT_DIFFERENCE,
    r.EVALUATION_RESULT_NAME
FROM REPOSITORY.VW_DATASET_TEST_EXECUTIONS te
JOIN RESULTS.TEST_EXECUTION_RESULTS r
    ON r.TEST_EXECUTION_ID = te.TEST_EXECUTION_ID
WHERE te.LATEST_TEST_EXECUTION_INDEX = 1
    AND te.TEST_NAME = 'Row Count - DIM_CUSTOMER';

Trend Analysis: Track Values Over Time

SELECT
    te.TEST_NAME,
    te.DATE_COMPLETED,
    r.NUMERIC_SOURCE_VALUE,
    r.NUMERIC_TARGET_VALUE,
    r.PERCENT_DIFFERENCE,
    r.EVALUATION_RESULT_NAME
FROM REPOSITORY.VW_DATASET_TEST_EXECUTIONS te
JOIN RESULTS.TEST_EXECUTION_RESULTS r
    ON r.TEST_EXECUTION_ID = te.TEST_EXECUTION_ID
WHERE te.TEST_ID = 58874
ORDER BY te.DATE_COMPLETED;

Find All Failed Single-Value Tests with Their Differences

SELECT
    te.TEST_NAME,
    te.TEST_PRIMARY_METADATA_LINK_OBJECT,
    te.DATE_COMPLETED,
    r.NUMERIC_SOURCE_VALUE,
    r.NUMERIC_TARGET_VALUE,
    r.ACTUAL_DIFFERENCE,
    ROUND(r.PERCENT_DIFFERENCE * 100, 2) AS PERCENT_DIFF_DISPLAY
FROM REPOSITORY.VW_DATASET_TEST_EXECUTIONS te
JOIN RESULTS.TEST_EXECUTION_RESULTS r
    ON r.TEST_EXECUTION_ID = te.TEST_EXECUTION_ID
WHERE te.LATEST_TEST_EXECUTION_INDEX = 1
    AND r.EVALUATION_RESULT_NAME = 'FAILED'
ORDER BY ABS(r.PERCENT_DIFFERENCE) DESC;

Databricks Notes

  • Table structure and column names are identical between Snowflake and Databricks
  • ROUND() function syntax is the same
  • The SF_DATE_CREATED and SF_IMPORT_FILENAME columns are Snowflake-specific metadata; in Databricks these may be named differently or absent depending on the loading mechanism