Default, unspecified predefined expression. No masking will take place
since no expression is specified.
Generated from protobuf enum PREDEFINED_EXPRESSION_UNSPECIFIED = 0;
SHA256
Value: 3
Masking expression to replace data with SHA-256 hash.
Generated from protobuf enum SHA256 = 3;
ALWAYS_NULL
Value: 5
Masking expression to replace data with NULLs.
Generated from protobuf enum ALWAYS_NULL = 5;
DEFAULT_MASKING_VALUE
Value: 7
Masking expression to replace data with their default masking values.
The default masking values for each type listed as below:
STRING: ""
BYTES: b''
INTEGER: 0
FLOAT: 0.0
NUMERIC: 0
BOOLEAN: FALSE
TIMESTAMP: 1970-01-01 00:00:00 UTC
DATE: 1970-01-01
TIME: 00:00:00
DATETIME: 1970-01-01T00:00:00
GEOGRAPHY: POINT(0 0)
BIGNUMERIC: 0
ARRAY: []
STRUCT: NOT_APPLICABLE
JSON: NULL
Generated from protobuf enum DEFAULT_MASKING_VALUE = 7;
LAST_FOUR_CHARACTERS
Value: 9
Masking expression shows the last four characters of text.
The masking behavior is as follows:
If text length > 4 characters: Replace text with XXXXX, append last
four characters of original text.
If text length <= 4 characters: Apply SHA-256 hash.
Generated from protobuf enum LAST_FOUR_CHARACTERS = 9;
FIRST_FOUR_CHARACTERS
Value: 10
Masking expression shows the first four characters of text.
The masking behavior is as follows:
If text length > 4 characters: Replace text with XXXXX, prepend first
four characters of original text.
If text length <= 4 characters: Apply SHA-256 hash.
Generated from protobuf enum FIRST_FOUR_CHARACTERS = 10;
EMAIL_MASK
Value: 12
Masking expression for email addresses.
The masking behavior is as follows:
Syntax-valid email address: Replace username with XXXXX. For example,
cloudysanfrancisco@gmail.com becomes XXXXX@gmail.com.
Syntax-invalid email address: Apply SHA-256 hash.
For more information, see Email
mask.
Generated from protobuf enum EMAIL_MASK = 12;
DATE_YEAR_MASK
Value: 13
Masking expression to only show the year of Date,
DateTime and TimeStamp. For example, with the
year 2076:
DATE : 2076-01-01
DATETIME : 2076-01-01T00:00:00
TIMESTAMP : 2076-01-01 00:00:00 UTC
Truncation occurs according to the UTC time zone. To change this, adjust
the default time zone using the time_zone system variable.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud BigQuery Data Policies V1 Client - Class PredefinedExpression (1.0.5)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.5 (latest)](/php/docs/reference/cloud-bigquery-datapolicies/latest/V1.DataMaskingPolicy.PredefinedExpression)\n- [1.0.4](/php/docs/reference/cloud-bigquery-datapolicies/1.0.4/V1.DataMaskingPolicy.PredefinedExpression)\n- [0.5.5](/php/docs/reference/cloud-bigquery-datapolicies/0.5.5/V1.DataMaskingPolicy.PredefinedExpression)\n- [0.4.1](/php/docs/reference/cloud-bigquery-datapolicies/0.4.1/V1.DataMaskingPolicy.PredefinedExpression)\n- [0.3.3](/php/docs/reference/cloud-bigquery-datapolicies/0.3.3/V1.DataMaskingPolicy.PredefinedExpression)\n- [0.2.4](/php/docs/reference/cloud-bigquery-datapolicies/0.2.4/V1.DataMaskingPolicy.PredefinedExpression)\n- [0.1.1](/php/docs/reference/cloud-bigquery-datapolicies/0.1.1/V1.DataMaskingPolicy.PredefinedExpression) \nReference documentation and code samples for the Google Cloud BigQuery Data Policies V1 Client class PredefinedExpression.\n\nThe available masking rules. Learn more here:\n\u003chttps://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options\u003e.\n\nProtobuf type `google.cloud.bigquery.datapolicies.v1.DataMaskingPolicy.PredefinedExpression`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ BigQuery \\\\ DataPolicies \\\\ V1 \\\\ DataMaskingPolicy\n\nMethods\n-------\n\n### static::name\n\n### static::value\n\nConstants\n---------\n\n### PREDEFINED_EXPRESSION_UNSPECIFIED\n\n Value: 0\n\nDefault, unspecified predefined expression. No masking will take place\nsince no expression is specified.\n\nGenerated from protobuf enum `PREDEFINED_EXPRESSION_UNSPECIFIED = 0;`\n\n### SHA256\n\n Value: 3\n\nMasking expression to replace data with SHA-256 hash.\n\nGenerated from protobuf enum `SHA256 = 3;`\n\n### ALWAYS_NULL\n\n Value: 5\n\nMasking expression to replace data with NULLs.\n\nGenerated from protobuf enum `ALWAYS_NULL = 5;`\n\n### DEFAULT_MASKING_VALUE\n\n Value: 7\n\nMasking expression to replace data with their default masking values.\n\nThe default masking values for each type listed as below:\n\n- STRING: \"\"\n- BYTES: b''\n- INTEGER: 0\n- FLOAT: 0.0\n- NUMERIC: 0\n- BOOLEAN: FALSE\n- TIMESTAMP: 1970-01-01 00:00:00 UTC\n- DATE: 1970-01-01\n- TIME: 00:00:00\n- DATETIME: 1970-01-01T00:00:00\n- GEOGRAPHY: POINT(0 0)\n- BIGNUMERIC: 0\n- ARRAY: \\[\\]\n- STRUCT: NOT_APPLICABLE\n- JSON: NULL\n\nGenerated from protobuf enum `DEFAULT_MASKING_VALUE = 7;`\n\n### LAST_FOUR_CHARACTERS\n\n Value: 9\n\nMasking expression shows the last four characters of text.\n\nThe masking behavior is as follows:\n\n- If text length \\\u003e 4 characters: Replace text with XXXXX, append last four characters of original text.\n- If text length \\\u003c= 4 characters: Apply SHA-256 hash.\n\nGenerated from protobuf enum `LAST_FOUR_CHARACTERS = 9;`\n\n### FIRST_FOUR_CHARACTERS\n\n Value: 10\n\nMasking expression shows the first four characters of text.\n\nThe masking behavior is as follows:\n\n- If text length \\\u003e 4 characters: Replace text with XXXXX, prepend first four characters of original text.\n- If text length \\\u003c= 4 characters: Apply SHA-256 hash.\n\nGenerated from protobuf enum `FIRST_FOUR_CHARACTERS = 10;`\n\n### EMAIL_MASK\n\n Value: 12\n\nMasking expression for email addresses.\n\nThe masking behavior is as follows:\n\n- Syntax-valid email address: Replace username with XXXXX. For example, cloudysanfrancisco@gmail.com becomes XXXXX@gmail.com.\n- Syntax-invalid email address: Apply SHA-256 hash. For more information, see [Email\n mask](https://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options).\n\nGenerated from protobuf enum `EMAIL_MASK = 12;`\n\n### DATE_YEAR_MASK\n\n Value: 13\n\nMasking expression to only show the year of `Date`,\n`DateTime` and `TimeStamp`. For example, with the\nyear 2076:\n\n- DATE : 2076-01-01\n- DATETIME : 2076-01-01T00:00:00\n- TIMESTAMP : 2076-01-01 00:00:00 UTC Truncation occurs according to the UTC time zone. To change this, adjust the default time zone using the `time_zone` system variable.\n\nFor more information, see the [a\nhref=\"https://cloud.google.com/bigquery/docs/reference/system-variables\"](about:invalid#zCSafez)System\nvariables reference.\n\nGenerated from protobuf enum `DATE_YEAR_MASK = 13;`"]]