Enum DataMaskingPolicy.PredefinedExpression (0.77.0)

publicenumDataMaskingPolicy.PredefinedExpressionextendsEnum<DataMaskingPolicy.PredefinedExpression>implementsProtocolMessageEnum

The available masking rules. Learn more here: https://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options.

Protobuf enum google.cloud.bigquery.datapolicies.v1.DataMaskingPolicy.PredefinedExpression

Implements

ProtocolMessageEnum

Static Fields

Name Description
ALWAYS_NULL

Masking expression to replace data with NULLs.

ALWAYS_NULL = 5;

ALWAYS_NULL_VALUE

Masking expression to replace data with NULLs.

ALWAYS_NULL = 5;

DATE_YEAR_MASK

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月01日T00: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. For more information, see the <a href="https://cloud.google.com/bigquery/docs/reference/system-variables">System variables reference</a>.

DATE_YEAR_MASK = 13;

DATE_YEAR_MASK_VALUE

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月01日T00: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. For more information, see the <a href="https://cloud.google.com/bigquery/docs/reference/system-variables">System variables reference</a>.

DATE_YEAR_MASK = 13;

DEFAULT_MASKING_VALUE

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月01日T00:00:00
  • GEOGRAPHY: POINT(0 0)
  • BIGNUMERIC: 0
  • ARRAY: []
  • STRUCT: NOT_APPLICABLE
  • JSON: NULL

DEFAULT_MASKING_VALUE = 7;

DEFAULT_MASKING_VALUE_VALUE

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月01日T00:00:00
  • GEOGRAPHY: POINT(0 0)
  • BIGNUMERIC: 0
  • ARRAY: []
  • STRUCT: NOT_APPLICABLE
  • JSON: NULL

DEFAULT_MASKING_VALUE = 7;

EMAIL_MASK

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.

EMAIL_MASK = 12;

EMAIL_MASK_VALUE

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.

EMAIL_MASK = 12;

FIRST_FOUR_CHARACTERS

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.

FIRST_FOUR_CHARACTERS = 10;

FIRST_FOUR_CHARACTERS_VALUE

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.

FIRST_FOUR_CHARACTERS = 10;

LAST_FOUR_CHARACTERS

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.

LAST_FOUR_CHARACTERS = 9;

LAST_FOUR_CHARACTERS_VALUE

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.

LAST_FOUR_CHARACTERS = 9;

PREDEFINED_EXPRESSION_UNSPECIFIED

Default, unspecified predefined expression. No masking will take place since no expression is specified.

PREDEFINED_EXPRESSION_UNSPECIFIED = 0;

PREDEFINED_EXPRESSION_UNSPECIFIED_VALUE

Default, unspecified predefined expression. No masking will take place since no expression is specified.

PREDEFINED_EXPRESSION_UNSPECIFIED = 0;

SHA256

Masking expression to replace data with SHA-256 hash.

SHA256 = 3;

SHA256_VALUE

Masking expression to replace data with SHA-256 hash.

SHA256 = 3;

UNRECOGNIZED

Static Methods

Name Description
forNumber(int value)
getDescriptor()
internalGetValueMap()
valueOf(Descriptors.EnumValueDescriptor desc)
valueOf(int value)

Deprecated. Use #forNumber(int) instead.

valueOf(String name)
values()

Methods

Name Description
getDescriptorForType()
getNumber()
getValueDescriptor()

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.