Google Cloud BigQuery Data Policies V1 Client - Class PredefinedExpression (0.4.1)

Reference documentation and code samples for the Google Cloud BigQuery Data Policies V1 Client class PredefinedExpression.

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

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

Namespace

Google \ Cloud \ BigQuery \ DataPolicies \ V1 \ DataMaskingPolicy

Methods

static::name

Parameter
NameDescription
value mixed

static::value

Parameter
NameDescription
name mixed

Constants

PREDEFINED_EXPRESSION_UNSPECIFIED

Value: 0

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.

For more information, see the a href="https://cloud.google.com/bigquery/docs/reference/system-variables"System variables reference.

Generated from protobuf enum DATE_YEAR_MASK = 13;