Google Cloud Dataplex V1 Client - Class DataQualityRule (0.14.0)

Reference documentation and code samples for the Google Cloud Dataplex V1 Client class DataQualityRule.

A rule captures data quality intent about a data source.

Generated from protobuf message google.cloud.dataplex.v1.DataQualityRule

Namespace

Google \ Cloud \ Dataplex \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ range_expectation Google\Cloud\Dataplex\V1\DataQualityRule\RangeExpectation

Row-level rule which evaluates whether each column value lies between a specified range.

↳ non_null_expectation Google\Cloud\Dataplex\V1\DataQualityRule\NonNullExpectation

Row-level rule which evaluates whether each column value is null.

↳ set_expectation Google\Cloud\Dataplex\V1\DataQualityRule\SetExpectation

Row-level rule which evaluates whether each column value is contained by a specified set.

↳ regex_expectation Google\Cloud\Dataplex\V1\DataQualityRule\RegexExpectation

Row-level rule which evaluates whether each column value matches a specified regex.

↳ uniqueness_expectation Google\Cloud\Dataplex\V1\DataQualityRule\UniquenessExpectation

Row-level rule which evaluates whether each column value is unique.

↳ statistic_range_expectation Google\Cloud\Dataplex\V1\DataQualityRule\StatisticRangeExpectation

Aggregate rule which evaluates whether the column aggregate statistic lies between a specified range.

↳ row_condition_expectation Google\Cloud\Dataplex\V1\DataQualityRule\RowConditionExpectation

Row-level rule which evaluates whether each row in a table passes the specified condition.

↳ table_condition_expectation Google\Cloud\Dataplex\V1\DataQualityRule\TableConditionExpectation

Aggregate rule which evaluates whether the provided expression is true for a table.

↳ column string

Optional. The unnested column which this rule is evaluated against.

↳ ignore_null bool

Optional. Rows with null values will automatically fail a rule, unless ignore_null is true. In that case, such null rows are trivially considered passing. This field is only valid for the following type of rules: * RangeExpectation * RegexExpectation * SetExpectation * UniquenessExpectation

↳ dimension string

Required. The dimension a rule belongs to. Results are also aggregated at the dimension level. Supported dimensions are ["COMPLETENESS", "ACCURACY", "CONSISTENCY", "VALIDITY", "UNIQUENESS", "INTEGRITY"]

↳ threshold float

Optional. The minimum ratio of passing_rows / total_rows required to pass this rule, with a range of [0.0, 1.0]. 0 indicates default value (i.e. 1.0). This field is only valid for row-level type rules.

↳ name string

Optional. A mutable name for the rule. * The name must contain only letters (a-z, A-Z), numbers (0-9), or hyphens (-). * The maximum length is 63 characters. * Must start with a letter. * Must end with a number or a letter.

↳ description string

Optional. Description of the rule. * The maximum length is 1,024 characters.

getRangeExpectation

Row-level rule which evaluates whether each column value lies between a specified range.

Returns
TypeDescription
Google\Cloud\Dataplex\V1\DataQualityRule\RangeExpectation|null

hasRangeExpectation

setRangeExpectation

Row-level rule which evaluates whether each column value lies between a specified range.

Parameter
NameDescription
var Google\Cloud\Dataplex\V1\DataQualityRule\RangeExpectation
Returns
TypeDescription
$this

getNonNullExpectation

Row-level rule which evaluates whether each column value is null.

Returns
TypeDescription
Google\Cloud\Dataplex\V1\DataQualityRule\NonNullExpectation|null

hasNonNullExpectation

setNonNullExpectation

Row-level rule which evaluates whether each column value is null.

Parameter
NameDescription
var Google\Cloud\Dataplex\V1\DataQualityRule\NonNullExpectation
Returns
TypeDescription
$this

getSetExpectation

Row-level rule which evaluates whether each column value is contained by a specified set.

Returns
TypeDescription
Google\Cloud\Dataplex\V1\DataQualityRule\SetExpectation|null

hasSetExpectation

setSetExpectation

Row-level rule which evaluates whether each column value is contained by a specified set.

Parameter
NameDescription
var Google\Cloud\Dataplex\V1\DataQualityRule\SetExpectation
Returns
TypeDescription
$this

getRegexExpectation

Row-level rule which evaluates whether each column value matches a specified regex.

Returns
TypeDescription
Google\Cloud\Dataplex\V1\DataQualityRule\RegexExpectation|null

hasRegexExpectation

setRegexExpectation

Row-level rule which evaluates whether each column value matches a specified regex.

Parameter
NameDescription
var Google\Cloud\Dataplex\V1\DataQualityRule\RegexExpectation
Returns
TypeDescription
$this

getUniquenessExpectation

Row-level rule which evaluates whether each column value is unique.

Returns
TypeDescription
Google\Cloud\Dataplex\V1\DataQualityRule\UniquenessExpectation|null

hasUniquenessExpectation

setUniquenessExpectation

Row-level rule which evaluates whether each column value is unique.

Parameter
NameDescription
var Google\Cloud\Dataplex\V1\DataQualityRule\UniquenessExpectation
Returns
TypeDescription
$this

getStatisticRangeExpectation

Aggregate rule which evaluates whether the column aggregate statistic lies between a specified range.

Returns
TypeDescription
Google\Cloud\Dataplex\V1\DataQualityRule\StatisticRangeExpectation|null

hasStatisticRangeExpectation

setStatisticRangeExpectation

Aggregate rule which evaluates whether the column aggregate statistic lies between a specified range.

Parameter
NameDescription
var Google\Cloud\Dataplex\V1\DataQualityRule\StatisticRangeExpectation
Returns
TypeDescription
$this

getRowConditionExpectation

Row-level rule which evaluates whether each row in a table passes the specified condition.

Returns
TypeDescription
Google\Cloud\Dataplex\V1\DataQualityRule\RowConditionExpectation|null

hasRowConditionExpectation

setRowConditionExpectation

Row-level rule which evaluates whether each row in a table passes the specified condition.

Parameter
NameDescription
var Google\Cloud\Dataplex\V1\DataQualityRule\RowConditionExpectation
Returns
TypeDescription
$this

getTableConditionExpectation

Aggregate rule which evaluates whether the provided expression is true for a table.

Returns
TypeDescription
Google\Cloud\Dataplex\V1\DataQualityRule\TableConditionExpectation|null

hasTableConditionExpectation

setTableConditionExpectation

Aggregate rule which evaluates whether the provided expression is true for a table.

Parameter
NameDescription
var Google\Cloud\Dataplex\V1\DataQualityRule\TableConditionExpectation
Returns
TypeDescription
$this

getColumn

Optional. The unnested column which this rule is evaluated against.

Returns
TypeDescription
string

setColumn

Optional. The unnested column which this rule is evaluated against.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getIgnoreNull

Optional. Rows with null values will automatically fail a rule, unless ignore_null is true. In that case, such null rows are trivially considered passing.

This field is only valid for the following type of rules:

  • RangeExpectation
  • RegexExpectation
  • SetExpectation
  • UniquenessExpectation
Returns
TypeDescription
bool

setIgnoreNull

Optional. Rows with null values will automatically fail a rule, unless ignore_null is true. In that case, such null rows are trivially considered passing.

This field is only valid for the following type of rules:

  • RangeExpectation
  • RegexExpectation
  • SetExpectation
  • UniquenessExpectation
Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getDimension

Required. The dimension a rule belongs to. Results are also aggregated at the dimension level. Supported dimensions are ["COMPLETENESS", "ACCURACY", "CONSISTENCY", "VALIDITY", "UNIQUENESS", "INTEGRITY"]

Returns
TypeDescription
string

setDimension

Required. The dimension a rule belongs to. Results are also aggregated at the dimension level. Supported dimensions are ["COMPLETENESS", "ACCURACY", "CONSISTENCY", "VALIDITY", "UNIQUENESS", "INTEGRITY"]

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getThreshold

Optional. The minimum ratio of passing_rows / total_rows required to pass this rule, with a range of [0.0, 1.0].

0 indicates default value (i.e. 1.0). This field is only valid for row-level type rules.

Returns
TypeDescription
float

setThreshold

Optional. The minimum ratio of passing_rows / total_rows required to pass this rule, with a range of [0.0, 1.0].

0 indicates default value (i.e. 1.0). This field is only valid for row-level type rules.

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getName

Optional. A mutable name for the rule.

  • The name must contain only letters (a-z, A-Z), numbers (0-9), or hyphens (-).
  • The maximum length is 63 characters.
  • Must start with a letter.
  • Must end with a number or a letter.
Returns
TypeDescription
string

setName

Optional. A mutable name for the rule.

  • The name must contain only letters (a-z, A-Z), numbers (0-9), or hyphens (-).
  • The maximum length is 63 characters.
  • Must start with a letter.
  • Must end with a number or a letter.
Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDescription

Optional. Description of the rule.

  • The maximum length is 1,024 characters.
Returns
TypeDescription
string

setDescription

Optional. Description of the rule.

  • The maximum length is 1,024 characters.
Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRuleType

Returns
TypeDescription
string