Skip to content

bigfunctions > detect_sensitive_info

detect_sensitive_info

Signature

detect_sensitive_info(text)

Description

Detect sensitive information in text using Cloud Data Loss Prevention

Examples

1. String with email in it.

select bigfunctions.eu.detect_sensitive_info("My email is shivam@google.co.in")
select bigfunctions.us.detect_sensitive_info("My email is shivam@google.co.in")
select bigfunctions.europe_west1.detect_sensitive_info("My email is shivam@google.co.in")
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| sensitive_info                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| [{"string": "shivam", "info_type": "PERSON_NAME", "confidence": "POSSIBLE"}, {"string": "shivam", "info_type": "FIRST_NAME", "confidence": "POSSIBLE"}, {"string": "shivam", "info_type": "FEMALE_NAME", "confidence": "POSSIBLE"}, {"string": "shivam", "info_type": "MALE_NAME", "confidence": "POSSIBLE"}, {"string": "google", "info_type": "ORGANIZATION_NAME", "confidence": "POSSIBLE"}, {"string": "shivam@google.co.in", "info_type": "EMAIL_ADDRESS", "confidence": "VERY_LIKELY"}, {"string": "google.co.in", "info_type": "DOMAIN_NAME", "confidence": "LIKELY"}] |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

2. String with phone number in it.

select bigfunctions.eu.detect_sensitive_info("My phone number is 0123456789")
select bigfunctions.us.detect_sensitive_info("My phone number is 0123456789")
select bigfunctions.europe_west1.detect_sensitive_info("My phone number is 0123456789")
+---------------------------------------------------------------------------------+
| sensitive_info                                                                  |
+---------------------------------------------------------------------------------+
| [{"string": "0123456789", "info_type": "PHONE_NUMBER", "confidence": "LIKELY"}] |
+---------------------------------------------------------------------------------+