Class: Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRule

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDataplexV1DataQualityRule

Returns a new instance of GoogleCloudDataplexV1DataQualityRule.



2561
2562
2563
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2561

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#columnString

Optional. The unnested column which this rule is evaluated against. Corresponds to the JSON property column

Returns:

  • (String)


2460
2461
2462
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2460

def column
  @column
end

#descriptionString

Optional. Description of the rule. The maximum length is 1,024 characters. Corresponds to the JSON property description

Returns:

  • (String)


2465
2466
2467
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2465

def description
  @description
end

#dimensionString

Required. The dimension a rule belongs to. Results are also aggregated at the dimension level. Supported dimensions are "COMPLETENESS", "ACCURACY", " CONSISTENCY", "VALIDITY", "UNIQUENESS", "FRESHNESS", "VOLUME" Corresponds to the JSON property dimension

Returns:

  • (String)


2472
2473
2474
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2472

def dimension
  @dimension
end

#ignore_nullBoolean 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

Returns:

  • (Boolean)


2480
2481
2482
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2480

def ignore_null
  @ignore_null
end

#nameString

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

Returns:

  • (String)


2488
2489
2490
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2488

def name
  @name
end

#non_null_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleNonNullExpectation

Evaluates whether each column value is null. Corresponds to the JSON property nonNullExpectation



2493
2494
2495
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2493

def non_null_expectation
  @non_null_expectation
end

#range_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRangeExpectation

Evaluates whether each column value lies between a specified range. Corresponds to the JSON property rangeExpectation



2498
2499
2500
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2498

def range_expectation
  @range_expectation
end

#regex_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRegexExpectation

Evaluates whether each column value matches a specified regex. Corresponds to the JSON property regexExpectation



2503
2504
2505
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2503

def regex_expectation
  @regex_expectation
end

#row_condition_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRowConditionExpectation

Evaluates whether each row passes the specified condition.The SQL expression needs to use BigQuery standard SQL syntax and should produce a boolean value per row as the result.Example: col1 >= 0 AND col2 < 10 Corresponds to the JSON property rowConditionExpectation



2510
2511
2512
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2510

def row_condition_expectation
  @row_condition_expectation
end

#set_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleSetExpectation

Evaluates whether each column value is contained by a specified set. Corresponds to the JSON property setExpectation



2515
2516
2517
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2515

def set_expectation
  @set_expectation
end

#sql_assertionGoogle::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 BigQuery standard SQL 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



2528
2529
2530
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2528

def sql_assertion
  @sql_assertion
end

#statistic_range_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleStatisticRangeExpectation

Evaluates whether the column aggregate statistic lies between a specified range. Corresponds to the JSON property statisticRangeExpectation



2534
2535
2536
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2534

def statistic_range_expectation
  @statistic_range_expectation
end

#suspendedBoolean Also known as: suspended?

Optional. Whether the Rule is active or suspended. Default is false. Corresponds to the JSON property suspended

Returns:

  • (Boolean)


2539
2540
2541
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2539

def suspended
  @suspended
end

#table_condition_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleTableConditionExpectation

Evaluates whether the provided expression is true.The SQL expression needs to use BigQuery standard SQL syntax and should produce a scalar boolean result. Example: MIN(col1) >= 0 Corresponds to the JSON property tableConditionExpectation



2547
2548
2549
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2547

def table_condition_expectation
  @table_condition_expectation
end

#thresholdFloat

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

Returns:

  • (Float)


2554
2555
2556
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2554

def threshold
  @threshold
end

#uniqueness_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleUniquenessExpectation

Evaluates whether the column has duplicates. Corresponds to the JSON property uniquenessExpectation



2559
2560
2561
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2559

def uniqueness_expectation
  @uniqueness_expectation
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
# File 'lib/google/apis/dataplex_v1/classes.rb', line 2566

def update!(**args)
  @column = args[:column] if args.key?(:column)
  @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)
  @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)
  @threshold = args[:threshold] if args.key?(:threshold)
  @uniqueness_expectation = args[:uniqueness_expectation] if args.key?(:uniqueness_expectation)
end