Personator Consumer Notebook: Databricks Reference Guide#
Notebook Configuration#
Follow the instructions to get the notebook and details about installation in Notebook Installation.
Check Single Contact#
The Check Single Contact notebook verifies and enriches an individual consumer contact record using the Personator Consumer API. It can return the response as JSON or write selected response fields to an output table.
Example#
Set up your license key using Databricks secrets. See Databricks License Key Set Up.
Fill in the required fields indicated by (*).
Click
Run allto run the notebook.The JSON response will be displayed in the View Results notebook section. If an output table is named, the result will append to the table.
Input Example
Output Example
Input Parameters#
The following table describes the input parameters for the Check Single Contact notebook. Provide at least one of the minimum input combinations.
Parameter |
Data Type |
Description |
Example |
|---|---|---|---|
License |
STRING |
Required. |
|
Input Fields |
STRING |
Provide supported input values in the corresponding fields listed under Input Fields. |
AddressLine1, |
Actions |
STRING |
[ActionName], separated by commas (,). Blank input defaults to |
Check,Move |
Columns |
STRING |
[ColumnName,GrpColumnsName], separated by commas (,). |
Plus4,GrpGeocode |
Options |
STRING |
[OptionName:Parameter], separated by semicolons (;). |
UsePreferredCity:on;Diacritics:off |
Output Table Name |
STRING |
The output table name. |
|
Output Table Fields |
STRING |
Case-sensitive. |
RecordID, |
Check Multiple Contacts#
The Check Multiple Contacts notebook processes contact information records in batches, validating and standardizing key components using the Personator Consumer API.
It can handle tables of any size, returning the results in a specified output table and supports optional fields for flexible, accurate contact verification.
Requirements#
To use this notebook, you need to prepare an input table in Databricks beforehand referencing our default input fields below.
Minimum Input Combinations#
Provide at least one of these combinations for each input record:
Set |
Fields |
|---|---|
Set A |
|
Set B |
|
Set C |
|
Set D |
|
Set E |
|
Set F |
|
Set G |
|
Set H |
|
Set I |
|
Set J |
|
Input Fields#
Every input table must include record_id and at least one minimum input combination above. The remaining fields are optional.
Column Name |
Data Type |
Description |
|---|---|---|
record_id |
STRING |
Required. |
address_line_1 |
STRING |
Address line 1. |
address_line_2 |
STRING |
Address line 2. |
age_approximate |
STRING |
Return individuals within a year of this age. |
age_greater_than |
STRING |
Return individuals older than this age. |
age_less_than |
STRING |
Return individuals younger than this age. |
birth_day |
STRING |
Birth day in |
birth_month |
STRING |
Birth month in |
birth_year |
STRING |
Birth year in |
city |
STRING |
City name. |
company_name |
STRING |
Organization name associated with the address. |
country |
STRING |
Country name, abbreviation, or code. Supports US and Canada; other countries return AS09 (Foreign Address). Invalid or blank input defaults to US or Canada. |
email_address |
STRING |
Email address. |
first_name |
STRING |
First name. |
free_form |
STRING |
Free form input for additional information. |
full_name |
STRING |
Full name. |
ip_address |
STRING |
IP address for the record. |
last_line |
STRING |
City, state, and ZIP. |
last_name |
STRING |
Last name. |
melissa_address_key |
STRING |
Melissa unique address key. |
melissa_identity_key |
STRING |
Melissa unique identity key. |
phone_number |
STRING |
Phone number. |
postal_code |
STRING |
Postal code. |
state |
STRING |
US state. |
Python Notebook Setup#
The step-by-step example below shows how to use the notebook. Replace with your values.
Step 0 - Prepare an input table
Assume that the input table has the signature below:
CREATE TABLE IF NOT EXISTS <catalog>.<schema>.<input_table> ( RecId INT, Address1 STRING, City STRING, State STRING, Zip STRING, Email STRING, Phone STRING, Name STRING );
This input table has different column names from the Input Fields. Mapping column names in Step 2 is necessary for the program to get the correct parameters.
Attention
Make sure your input table contains unique RecordID before running the next script. See more about Batch Processing Best Practices.
Step 1 - Required Privileges
Ensure you have the necessary access to the input table and output table including
SELECT,INSERT,UPDATE,USE SCHEMA, andUSE CATALOGprivileges for the tables involved.Step 2 - Map Input Columns with the Default Input Fields
Set the required parameters and map your input columns to our Input Fields.
Check Input Parameters for more information.
from melissadatacloudapi_databricks import Config, PERSONATOR_CONSUMER, run config = Config( license_key=LICENSE_KEY, input_table="<catalog>.<schema>.<input_table>", output_table="<catalog>.<schema>.<output_table>", # Map your input columns with our input fields, replace with your actual column names # For optional columns, leave the field as "". parameter_mapping={ "record_id": "RecId", "address_line_1": "Address1", "city": "City", "state": "State", "postal_code": "Zip", "email_address": "Email", "phone_number": "Phone", "full_name": "Name", "last_line": "", "ip_address": "", "free_form": "", "melissa_address_key": "", "melissa_identity_key": "", "first_name": "", "last_name": "", "company_name": "", "address_line_2": "", "country": "", "birth_day": "", "birth_month": "", "birth_year": "", "age_approximate": "", "age_greater_than": "", "age_less_than": "", }, request_parameters={ "actions": "Check", "columns": "", "options": "", }, output_columns="<field_1,field_2>", log_to_table=False, log_table="<catalog>.<schema>.<log_table>", duplicate_check=False, )
Step 3 - Call run() to verify your data
run(PERSONATOR_CONSUMER, config, spark=spark, dbutils=dbutils) # Output table view display( spark.sql( f"SELECT * FROM {config.output_table} ORDER BY TRY_CAST(RecordID AS BIGINT), RecordID LIMIT 1000" ) )
Input Parameters#
The following table describes the input parameters for the Check Multiple Contacts notebook.
Parameter |
Data Type |
Description |
Example |
|---|---|---|---|
license_key |
STRING |
Required. |
|
parameter_mapping |
Connects each Melissa field to a column in your input table. See Input Fields. |
||
request_parameters |
Sent once with every batch, applied to every record. |
Check,Move |
|
input_table |
STRING |
Required. |
catalog.schema.input_table_name |
output_table |
STRING |
Required. |
catalog.schema.output_table_name |
output_columns |
STRING |
Case-sensitive. |
RecordID, |
log_to_table |
BOOLEAN |
Enable or disable logs to facilitate troubleshooting in case of any issues. |
True |
log_table |
STRING |
Name of the log table. Only valid when log_to_table = |
catalog.schema.log_table_name |
duplicate_check |
BOOLEAN |
Enable or disable several checks for duplicate RecordID. |
True |
Default Output Fields#
If output_columns is an empty string or not provided, output table will have a default schema as below.
Column Name |
Data Type |
|---|---|
RecordID |
STRING |
MelissaAddressKey |
STRING |
MelissaAddressKeyBase |
STRING |
InCompany |
STRING |
InFullName |
STRING |
InEmail |
STRING |
InPhone |
STRING |
InAddressLine1 |
STRING |
InAddressLine2 |
STRING |
InCity |
STRING |
InState |
STRING |
InPostalCode |
STRING |
InCountry |
STRING |
InMelissaAddressKey |
STRING |
InFirstName |
STRING |
InLastName |
STRING |
InIPAddress |
STRING |
InMelissaIdentityKey |
STRING |
Results |
STRING |
CompanyName |
STRING |
NameFull |
STRING |
AddressLine1 |
STRING |
AddressLine2 |
STRING |
City |
STRING |
State |
STRING |
PostalCode |
STRING |
AddressKey |
STRING |
Reserved |
STRING |
Timestamp |
TIMESTAMP |
Result Codes#
For the full list of result codes returned by Personator Consumer Notebook: Databricks, please visit here.
Interpreting Results#
The SE## and GE## codes (Transmission Service Error and General Transmission Error) are used to signify more general errors, and are returned under the key TransmissionResults in the outermost level of our responses.
The Personator API and other Melissa APIs will have a Results Output. Several different Result Codes may be returned by the service in order to give you detailed information about the status of the record submitted.
It is important to understand these result codes in order for you to make a determination of good vs bad data and how you would want to use it.
The following shows you the indicators for the different results:
Code |
Description |
Quality Indicator |
|---|---|---|
|
The address is valid and deliverable according to official postal agencies. |
Good Data |
|
The building address was verified but the suite/apartment number is missing or invalid. |
Good Data |
|
US Only. This US address is not serviced by the USPS but does exist and may receive mail through third party carriers like UPS. |
Good Data |
|
The phone number has been verified as valid. |
Good Data |
|
This email address has correct syntax and belongs to a domain known to receive mail. This does not indicate a mailbox-level deliverability check was performed. To perform real-time checks and see DCS score, use Global Email with option |
Good Data |
|
Name parsing was successful. |
Good Data |
|
Results that begin with |
Bad Data |
|
Results that begin with |
Bad Data |
|
Results that begin with |
Bad Data |
|
Results that begin with |
Bad Data |
|
The record was geocoded down to the rooftop level, meaning the point is within the property boundaries, usually the center. |
High Accuracy GeoCoding |
|
The record was geocoded down to the rooftop level using interpolation (educated estimations using street coordinates). The point may be in or close to the property boundaries. |
High Accuracy GeoCoding |
|
The record was coded to the street level (Zip+4 for US, full postal code for CA). |
Medium Accuracy GeoCoding |