Run validation

Use the validation procedures directly from SQL, or use the app's Test and scale your app and Job dashboard pages to generate and run the calls.

The examples below assume the app is installed as EDQ.

Single-record validation

Single-record procedures return the response as a JSON string. Use PARSE_JSON to parse the response and extract fields in SQL.

SELECT
  id,
  address,
  PARSE_JSON(EDQ.VALIDATION.Address(address, NULL, 'USA')) AS validation_result
FROM SOURCE_DB.SCHEMA.CONTACTS_TABLE;

The third parameter is optional, but Address Validation needs a configured country. You can pass a three-letter ISO code such as USA, or a country name configured in the country ISO mapping.

SELECT
  id,
  result:is_success::BOOLEAN AS is_success,
  result:result:confidence::STRING AS confidence,
  result:result:address:address_line_1::STRING AS address_line_1,
  result:result:address:locality::STRING AS locality,
  result:result:address:postal_code::STRING AS postal_code
FROM (
  SELECT
    id,
    PARSE_JSON(EDQ.VALIDATION.Address(address, NULL, 'USA')) AS result
  FROM SOURCE_DB.SCHEMA.CONTACTS_TABLE
);
SELECT
  id,
  email,
  PARSE_JSON(EDQ.VALIDATION.Email(email)) AS validation_result
FROM SOURCE_DB.SCHEMA.CONTACTS_TABLE;
SELECT
  id,
  result:is_success::BOOLEAN AS is_success,
  result:result:confidence::STRING AS confidence,
  result:result:email::STRING AS normalized_email,
  result:result:did_you_mean::STRING AS suggested_correction
FROM (
  SELECT
    id,
    PARSE_JSON(EDQ.VALIDATION.Email(email)) AS result
  FROM SOURCE_DB.SCHEMA.CONTACTS_TABLE
);
SELECT
  id,
  phone,
  PARSE_JSON(EDQ.VALIDATION.Phone(phone)) AS validation_result
FROM SOURCE_DB.SCHEMA.CONTACTS_TABLE;
SELECT
  id,
  result:is_success::BOOLEAN AS is_success,
  result:result:confidence::STRING AS confidence,
  result:result:formatted_phone_number::STRING AS formatted_phone,
  result:result:phone_type::STRING AS phone_type
FROM (
  SELECT
    id,
    PARSE_JSON(EDQ.VALIDATION.Phone(phone)) AS result
  FROM SOURCE_DB.SCHEMA.CONTACTS_TABLE
);

Bulk validation

Bulk procedures queue an asynchronous job and return immediately with a job_id, status, output_table, and a message. The background task processes source data in 10,000-record chunks and writes results to EDQ.RESULTS.

CALL EDQ.VALIDATION.SubmitBulkAddress(
  'SOURCE_DB.SCHEMA.CONTACTS_TABLE',
  'address',
  'id',
  'ADDRESS_RESULTS',
  'is_active = TRUE',
  'country',
  'datasets'
);
Parameter Required Description
source_table_fqn Yes Source table or view, in DB.SCHEMA.TABLE form.
address_column Yes Column containing the address string to validate.
id_column Yes Stable ID column used as record_id in the results.
output_table_name Yes Name of the result table to create in EDQ.RESULTS.
where_clause No Filter expression without the WHERE keyword.
country_column No Per-row country override. Values can be ISO3 codes or configured country names.
datasets_column No Per-row dataset override. Values can be a dataset string, comma-separated list or JSON array.

Address result tables include:

Field group Fields
Job and source job_id, chunk_id, timestamp, record_id, address_input, country_iso, datasets_json
Status is_valid, is_success, http_status, error_type, error_title, error_detail, error_instance
Match result confidence, match_type, match_confidence
Standardized address address_line_1, address_line_2, address_line_3, locality, region, postal_code, country
Detailed JSON addresses_formatted, components, metadata, match_info, result_json
CALL EDQ.VALIDATION.SubmitBulkEmail(
  'SOURCE_DB.SCHEMA.CONTACTS_TABLE',
  'email',
  'id',
  'EMAIL_RESULTS',
  'is_active = TRUE'
);
Parameter Required Description
source_table_fqn Yes Source table or view, in DB.SCHEMA.TABLE form.
email_column Yes Column containing the email address.
id_column Yes Stable ID column used as record_id in the results.
output_table_name Yes Name of the result table to create in EDQ.RESULTS.
where_clause No Filter expression without the WHERE keyword.

Email result tables include job_id, chunk_id, timestamp, record_id, email_address, is_valid, is_success, http_status, error fields, confidence, email, verbose_output, did_you_mean and metadata_json.

CALL EDQ.VALIDATION.SubmitBulkPhone(
  'SOURCE_DB.SCHEMA.CONTACTS_TABLE',
  'phone',
  'id',
  'PHONE_RESULTS',
  'is_active = TRUE'
);
Parameter Required Description
source_table_fqn Yes Source table or view, in DB.SCHEMA.TABLE form.
phone_column Yes Column containing the phone number.
id_column Yes Stable ID column used as record_id in the results.
output_table_name Yes Name of the result table to create in EDQ.RESULTS.
where_clause No Filter expression without the WHERE keyword.

Phone result tables include job_id, chunk_id, timestamp, record_id, phone_number, is_valid, is_success, http_status, error fields, confidence, number, validated_phone_number, formatted_phone_number, phone_type, ported_date, disposable_number and metadata_json.

Monitor and query results

Use JobStatus to monitor progress:

CALL EDQ.VALIDATION.JobStatus('<job_id>');

When the job status is completed or partial, query the output table returned by the submit procedure:

SELECT *
FROM EDQ.RESULTS.EMAIL_RESULTS
WHERE job_id = '<job_id>'
LIMIT 100;

List recent jobs:

SELECT * FROM TABLE(EDQ.VALIDATION.JobList());

Cancel or retry a job:

CALL EDQ.VALIDATION.CancelJob('<job_id>');
CALL EDQ.VALIDATION.RetryJob('<job_id>');