Global Name Notebook: Databricks Reference Guide#
Notebook Configuration#
Follow the instructions to get the notebook and details about installation in Notebook Installation.
Verify Single Name#
The Verify Single Name notebook validates and standardizes an individual name using the Global Name 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 Verify Single Name notebook.
Parameter |
Data Type |
Description |
Example |
|---|---|---|---|
License |
STRING |
Required. |
|
Full Name |
STRING |
Required. |
Mr. John Doe |
Company |
STRING |
The name of the business. |
Melissa |
Country |
STRING |
Required. |
US |
Options |
STRING |
[OptionName:Parameter], separated by commas (,). |
CorrectFirstName:On |
Output Table Name |
STRING |
The output table name. |
|
Output Table Fields |
STRING |
Case-sensitive. |
RecordID, |
Verify Multiple Names#
The Verify Multiple Names notebook processes name records in batches, validating and standardizing key components using the Global Name API.
It can handle tables of any size, returning the results in a specified output table and supports optional fields for flexible, accurate name validation.
Requirements#
To use this notebook, you need to prepare an input table in Databricks beforehand referencing our default input fields below.
Input Fields#
Column Name |
Data Type |
Description |
|---|---|---|
record_id |
STRING |
Required. |
full_name |
STRING |
Required. |
country |
STRING |
The country code. |
company |
STRING |
The name of the business. Empty string is accepted. |
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, Name STRING, CountryCode STRING, CompanyName 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, GLOBAL_NAME, 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", "full_name": "Name", "country": "CountryCode", "company": "CompanyName", }, request_parameters={ "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(GLOBAL_NAME, 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 Verify Multiple Names 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. |
CorrectFirstName:On |
|
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 Settings#
Default Input Options#
If input options is empty, default input options will be:
Parameter |
Value |
|---|---|
options |
TODO |
See endpoint options for available service options.
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 |
InCompany |
STRING |
InFullName |
STRING |
Company |
STRING |
NamePrefix |
STRING |
NameFirst |
STRING |
NameMiddle |
STRING |
NameLast |
STRING |
NameSuffix |
STRING |
NameNickname |
STRING |
Gender |
STRING |
Salutation |
STRING |
Results |
STRING |
Timestamp |
TIMESTAMP |
Result Codes#
For the full list of result codes returned by Global Name Notebook: Databricks, please visit here.
Interpreting Results#
Melissa products use a result code system to indicate data quality; the status and any errors. These result codes are four-character codes (two letters followed by two numbers), delimited by commas. Result code definitions are shared among Melissa products. Instead of looking at multiple properties and methods to determine status, you can look at the output of the results parameter.
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 NS## and NE## codes (Name Status and Name Error) are returned alongside each name record in a request.
Example
This example input: ‘Mr John and Mrs Mary Jones’ will return the result code string:
NS01, NS05, NS06, NS07, NS08
From these result codes you can determine that the disposition of the Name is:
Code |
Description |
Recommendation |
|---|---|---|
|
Name parsing was successful. |
Medium |
|
FirstName1 was found in our table of names. Very likely to be a real first name. |
Good |
|
LastName1, or part of a hyphenated name, was found in our table of names. Very likely to be a real last name. |
Good |
|
FirstName2 was found in our table of names. Very likely to be a real first name. |
Good |
|
LastName2, or part of a hyphenated name, was found in our table of names. Very likely to be a real last name. |
Good |
Some other result codes examples:
Code |
Description |
Recommendation |
|---|---|---|
|
An error was detected. Please check for a name error code. |
Bad |
|
A vulgarity was detected in the name. |
Bad |
|
The name contained words found on the list of nuisance names, such as “Mickey Mouse.” |
Bad |