is_email_valid¶
is_email_valid(email)
Description¶
Return true if email
is valid
(inspired from this reddit answer)
Usage¶
Call or Deploy is_email_valid
?
Call is_email_valid
directly
The easiest way to use bigfunctions
is_email_valid
function is deployed in 39 public datasets for all of the 39 BigQuery regions.- It can be called by anyone. Just copy / paste examples below in your BigQuery console. It just works!
- (You need to use the dataset in the same region as your datasets otherwise you may have a function not found error)
Public BigFunctions Datasets
Region | Dataset |
---|---|
eu |
bigfunctions.eu |
us |
bigfunctions.us |
europe-west1 |
bigfunctions.europe_west1 |
asia-east1 |
bigfunctions.asia_east1 |
... | ... |
Deploy is_email_valid
in your project
Why deploy?
- You may prefer to deploy
is_email_valid
in your own project to build and manage your own catalog of functions. - This is particularly useful if you want to create private functions (for example calling your internal APIs).
- Get started by reading the framework page
Deployment
is_email_valid
function can be deployed with:
pip install bigfunctions
bigfun get is_email_valid
bigfun deploy is_email_valid
Examples¶
1. with a valid email
select bigfunctions.eu.is_email_valid("paul.marcombes@unytics.io")
select bigfunctions.us.is_email_valid("paul.marcombes@unytics.io")
select bigfunctions.europe_west1.is_email_valid("paul.marcombes@unytics.io")
+----------------+
| is_email_valid |
+----------------+
| true |
+----------------+
2. with incorrect format
select bigfunctions.eu.is_email_valid("paul/marcombes@example.com")
select bigfunctions.us.is_email_valid("paul/marcombes@example.com")
select bigfunctions.europe_west1.is_email_valid("paul/marcombes@example.com")
+----------------+
| is_email_valid |
+----------------+
| false |
+----------------+
3. with a domain not registrable
select bigfunctions.eu.is_email_valid("paul.marcombes@example.con")
select bigfunctions.us.is_email_valid("paul.marcombes@example.con")
select bigfunctions.europe_west1.is_email_valid("paul.marcombes@example.con")
+----------------+
| is_email_valid |
+----------------+
| false |
+----------------+
Use cases¶
A common use case for the is_email_valid
function would be cleaning or validating customer data in a BigQuery table.
Imagine you have a table of user information, including an email address column. You want to identify and potentially correct or remove invalid email addresses.
Scenario:
You have a table named users
with columns like user_id
, name
, and email
. You want to create a new table containing only users with valid email addresses.
Query:
SELECT *
FROM `your_project.your_dataset.users`
WHERE bigfunctions.your_region.is_email_valid(email);
Replace your_project
, your_dataset
, and your_region
with your actual project ID, dataset ID and BigQuery region respectively (like bigfunctions.eu
if your dataset is in EU multi-region).
This query uses the is_email_valid
function to filter the users
table, keeping only rows where the email
column contains a valid email address according to the function's validation criteria.
Other Use Cases:
- Data Quality Reporting: Generate reports on the percentage of valid email addresses in your data. This helps track data quality and identify potential issues.
- Pre-processing for Marketing Campaigns: Ensure that your marketing emails are sent only to valid email addresses, reducing bounce rates and improving campaign effectiveness.
- Form Validation: Use the function as part of a data pipeline to validate email addresses submitted through online forms before storing them in your database.
- Lead Scoring: Assign higher scores to leads with valid email addresses, prioritizing them for sales outreach.
By incorporating the is_email_valid
function into your BigQuery workflows, you can improve the accuracy and reliability of your data, leading to better decision-making and more effective business processes.
Need help or Found a bug?
Get help using is_email_valid
The community can help! Engage the conversation on Slack
We also provide professional suppport.
Report a bug about is_email_valid
If the function does not work as expected, please
- report a bug so that it can be improved.
- or open the discussion with the community on Slack.
We also provide professional suppport.