Class: Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRule
- Inherits:
-
Object
- Object
- Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRule
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/dataplex_v1/classes.rb,
lib/google/apis/dataplex_v1/representations.rb,
lib/google/apis/dataplex_v1/representations.rb
Overview
A rule captures data quality intent about a data source.
Instance Attribute Summary collapse
-
#attributes ⇒ Hash<String,String>
Optional.
-
#column ⇒ String
Optional.
-
#debug_queries ⇒ Array<Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleDebugQuery>
Optional.
-
#description ⇒ String
Optional.
-
#dimension ⇒ String
Optional.
-
#ignore_null ⇒ Boolean
(also: #ignore_null?)
Optional.
-
#name ⇒ String
Optional.
-
#non_null_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleNonNullExpectation
Evaluates whether each column value is null.
-
#range_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRangeExpectation
Evaluates whether each column value lies between a specified range.
-
#regex_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRegexExpectation
Evaluates whether each column value matches a specified regex.
-
#row_condition_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRowConditionExpectation
Evaluates whether each row passes the specified condition.The SQL expression needs to use GoogleSQL syntax (https://cloud.google.com/bigquery/docs/ reference/standard-sql/query-syntax) and should produce a boolean value per row as the result.Example: col1 >= 0 AND col2 < 10 Corresponds to the JSON property
rowConditionExpectation. -
#rule_source ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRuleSource
Represents the rule source information from Catalog.
-
#set_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleSetExpectation
Evaluates whether each column value is contained by a specified set.
-
#sql_assertion ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleSqlAssertion
A SQL statement that is evaluated to return rows that match an invalid state.
-
#statistic_range_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleStatisticRangeExpectation
Evaluates whether the column aggregate statistic lies between a specified range.
-
#suspended ⇒ Boolean
(also: #suspended?)
Optional.
-
#table_condition_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleTableConditionExpectation
Evaluates whether the provided expression is true.The SQL expression needs to use GoogleSQL syntax (https://cloud.google.com/bigquery/docs/reference/ standard-sql/query-syntax) and should produce a scalar boolean result.Example: MIN(col1) >= 0 Corresponds to the JSON property
tableConditionExpectation. -
#template_reference ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleTemplateReference
A rule that constructs a SQL statement to evaluate using a rule template and parameter values.
-
#threshold ⇒ Float
Optional.
-
#uniqueness_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleUniquenessExpectation
Evaluates whether the column has duplicates.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudDataplexV1DataQualityRule
constructor
A new instance of GoogleCloudDataplexV1DataQualityRule.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudDataplexV1DataQualityRule
Returns a new instance of GoogleCloudDataplexV1DataQualityRule.
3781 3782 3783 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3781 def initialize(**args) update!(**args) end |
Instance Attribute Details
#attributes ⇒ Hash<String,String>
Optional. Map of attribute name and value linked to the rule. The rules to
evaluate can be filtered based on attributes provided here and a filter
expression provided in the DataQualitySpec.filter field.
Corresponds to the JSON property attributes
3654 3655 3656 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3654 def attributes @attributes end |
#column ⇒ String
Optional. The unnested column which this rule is evaluated against.
Corresponds to the JSON property column
3659 3660 3661 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3659 def column @column end |
#debug_queries ⇒ Array<Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleDebugQuery>
Optional. Specifies the debug queries for this rule. Currently, only one query
is supported, but this may be expanded in the future.
Corresponds to the JSON property debugQueries
3665 3666 3667 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3665 def debug_queries @debug_queries end |
#description ⇒ String
Optional. Description of the rule. The maximum length is 1,024 characters.
Corresponds to the JSON property description
3670 3671 3672 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3670 def description @description end |
#dimension ⇒ String
Optional. The dimension a rule belongs to. Results are also aggregated at the
dimension level. Custom dimension name is supported with all uppercase letters
and maximum length of 30 characters.
Corresponds to the JSON property dimension
3677 3678 3679 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3677 def dimension @dimension end |
#ignore_null ⇒ Boolean Also known as: ignore_null?
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
Corresponds to the JSON property ignoreNull
3685 3686 3687 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3685 def ignore_null @ignore_null end |
#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.
Corresponds to the JSON property name
3693 3694 3695 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3693 def name @name end |
#non_null_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleNonNullExpectation
Evaluates whether each column value is null.
Corresponds to the JSON property nonNullExpectation
3698 3699 3700 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3698 def non_null_expectation @non_null_expectation end |
#range_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRangeExpectation
Evaluates whether each column value lies between a specified range.
Corresponds to the JSON property rangeExpectation
3703 3704 3705 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3703 def range_expectation @range_expectation end |
#regex_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRegexExpectation
Evaluates whether each column value matches a specified regex.
Corresponds to the JSON property regexExpectation
3708 3709 3710 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3708 def regex_expectation @regex_expectation end |
#row_condition_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRowConditionExpectation
Evaluates whether each row passes the specified condition.The SQL expression
needs to use GoogleSQL syntax (https://cloud.google.com/bigquery/docs/
reference/standard-sql/query-syntax) and should produce a boolean value per
row as the result.Example: col1 >= 0 AND col2 < 10
Corresponds to the JSON property rowConditionExpectation
3716 3717 3718 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3716 def row_condition_expectation @row_condition_expectation end |
#rule_source ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRuleSource
Represents the rule source information from Catalog.
Corresponds to the JSON property ruleSource
3721 3722 3723 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3721 def rule_source @rule_source end |
#set_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleSetExpectation
Evaluates whether each column value is contained by a specified set.
Corresponds to the JSON property setExpectation
3726 3727 3728 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3726 def set_expectation @set_expectation end |
#sql_assertion ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleSqlAssertion
A SQL statement that is evaluated to return rows that match an invalid state.
If any rows are are returned, this rule fails.The SQL statement must use
GoogleSQL syntax (https://cloud.google.com/bigquery/docs/reference/standard-
sql/query-syntax), and must not contain any semicolons.You can use the data
reference parameter $data() to reference the source table with all of its
precondition filters applied. Examples of precondition filters include row
filters, incremental data filters, and sampling. For more information, see
Data reference parameter (https://cloud.google.com/dataplex/docs/auto-data-
quality-overview#data-reference-parameter).Example: SELECT * FROM $data()
WHERE price < 0
Corresponds to the JSON property sqlAssertion
3740 3741 3742 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3740 def sql_assertion @sql_assertion end |
#statistic_range_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleStatisticRangeExpectation
Evaluates whether the column aggregate statistic lies between a specified
range.
Corresponds to the JSON property statisticRangeExpectation
3746 3747 3748 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3746 def statistic_range_expectation @statistic_range_expectation end |
#suspended ⇒ Boolean Also known as: suspended?
Optional. Whether the Rule is active or suspended. Default is false.
Corresponds to the JSON property suspended
3751 3752 3753 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3751 def suspended @suspended end |
#table_condition_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleTableConditionExpectation
Evaluates whether the provided expression is true.The SQL expression needs to
use GoogleSQL syntax (https://cloud.google.com/bigquery/docs/reference/
standard-sql/query-syntax) and should produce a scalar boolean result.Example:
MIN(col1) >= 0
Corresponds to the JSON property tableConditionExpectation
3760 3761 3762 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3760 def table_condition_expectation @table_condition_expectation end |
#template_reference ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleTemplateReference
A rule that constructs a SQL statement to evaluate using a rule template and
parameter values. If the constructed statement returns any rows, this rule
fails
Corresponds to the JSON property templateReference
3767 3768 3769 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3767 def template_reference @template_reference end |
#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.
Corresponds to the JSON property threshold
3774 3775 3776 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3774 def threshold @threshold end |
#uniqueness_expectation ⇒ Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleUniquenessExpectation
Evaluates whether the column has duplicates.
Corresponds to the JSON property uniquenessExpectation
3779 3780 3781 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3779 def uniqueness_expectation @uniqueness_expectation end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 |
# File 'lib/google/apis/dataplex_v1/classes.rb', line 3786 def update!(**args) @attributes = args[:attributes] if args.key?(:attributes) @column = args[:column] if args.key?(:column) @debug_queries = args[:debug_queries] if args.key?(:debug_queries) @description = args[:description] if args.key?(:description) @dimension = args[:dimension] if args.key?(:dimension) @ignore_null = args[:ignore_null] if args.key?(:ignore_null) @name = args[:name] if args.key?(:name) @non_null_expectation = args[:non_null_expectation] if args.key?(:non_null_expectation) @range_expectation = args[:range_expectation] if args.key?(:range_expectation) @regex_expectation = args[:regex_expectation] if args.key?(:regex_expectation) @row_condition_expectation = args[:row_condition_expectation] if args.key?(:row_condition_expectation) @rule_source = args[:rule_source] if args.key?(:rule_source) @set_expectation = args[:set_expectation] if args.key?(:set_expectation) @sql_assertion = args[:sql_assertion] if args.key?(:sql_assertion) @statistic_range_expectation = args[:statistic_range_expectation] if args.key?(:statistic_range_expectation) @suspended = args[:suspended] if args.key?(:suspended) @table_condition_expectation = args[:table_condition_expectation] if args.key?(:table_condition_expectation) @template_reference = args[:template_reference] if args.key?(:template_reference) @threshold = args[:threshold] if args.key?(:threshold) @uniqueness_expectation = args[:uniqueness_expectation] if args.key?(:uniqueness_expectation) end |