public sealed class DataQualityRule : IMessage<DataQualityRule>, IEquatable<DataQualityRule>, IDeepCloneable<DataQualityRule>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud Dataplex v1 API class DataQualityRule.
A rule captures data quality intent about a data source.
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"]
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:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis documentation page covers the \u003ccode\u003eDataQualityRule\u003c/code\u003e class within the Google Cloud Dataplex v1 API for .NET, which is designed to define data quality rules for data sources.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDataQualityRule\u003c/code\u003e class allows you to define various types of rules, including row-level rules like \u003ccode\u003eNonNullExpectation\u003c/code\u003e, \u003ccode\u003eRangeExpectation\u003c/code\u003e, \u003ccode\u003eRegexExpectation\u003c/code\u003e, \u003ccode\u003eSetExpectation\u003c/code\u003e, and \u003ccode\u003eUniquenessExpectation\u003c/code\u003e, as well as aggregate rules such as \u003ccode\u003eSqlAssertion\u003c/code\u003e, \u003ccode\u003eStatisticRangeExpectation\u003c/code\u003e, and \u003ccode\u003eTableConditionExpectation\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the \u003ccode\u003eDataQualityRule\u003c/code\u003e class is version 3.6.0, and there are many previous versions listed, ranging from 1.0.0 to 3.5.0.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eDataQualityRule\u003c/code\u003e class include \u003ccode\u003eColumn\u003c/code\u003e (the column being evaluated), \u003ccode\u003eDimension\u003c/code\u003e (the data quality dimension the rule belongs to), \u003ccode\u003eIgnoreNull\u003c/code\u003e (handling of null values), \u003ccode\u003eName\u003c/code\u003e (a mutable name for the rule), and \u003ccode\u003eSuspended\u003c/code\u003e (whether the rule is active).\u003c/p\u003e\n"],["\u003cp\u003eThe class implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and the class is derived from the base \u003ccode\u003eobject\u003c/code\u003e class.\u003c/p\u003e\n"]]],[],null,["# Cloud Dataplex v1 API - Class DataQualityRule (3.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/latest/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/3.8.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/3.7.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/3.6.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/3.5.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/3.4.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/3.3.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/3.2.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/3.1.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/3.0.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.15.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.14.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.14.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.13.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.13.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.12.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.11.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.10.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.9.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.8.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.7.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.6.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.5.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.4.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.3.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.2.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.1.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/2.0.0/Google.Cloud.Dataplex.V1.DataQualityRule)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/1.0.0/Google.Cloud.Dataplex.V1.DataQualityRule) \n\n public sealed class DataQualityRule : IMessage\u003cDataQualityRule\u003e, IEquatable\u003cDataQualityRule\u003e, IDeepCloneable\u003cDataQualityRule\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Dataplex v1 API class DataQualityRule.\n\nA rule captures data quality intent about a data source. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e DataQualityRule \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[DataQualityRule](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/latest/Google.Cloud.Dataplex.V1.DataQualityRule), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[DataQualityRule](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/latest/Google.Cloud.Dataplex.V1.DataQualityRule), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[DataQualityRule](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/latest/Google.Cloud.Dataplex.V1.DataQualityRule), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Dataplex.V1](/dotnet/docs/reference/Google.Cloud.Dataplex.V1/latest/Google.Cloud.Dataplex.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Dataplex.V1.dll\n\nConstructors\n------------\n\n### DataQualityRule()\n\n public DataQualityRule()\n\n### DataQualityRule(DataQualityRule)\n\n public DataQualityRule(DataQualityRule other)\n\nProperties\n----------\n\n### Column\n\n public string Column { get; set; }\n\nOptional. The unnested column which this rule is evaluated against.\n\n### Description\n\n public string Description { get; set; }\n\nOptional. Description of the rule.\n\n- The maximum length is 1,024 characters.\n\n### Dimension\n\n public string Dimension { get; set; }\n\nRequired. The dimension a rule belongs to. Results are also aggregated at\nthe dimension level. Supported dimensions are **\\[\"COMPLETENESS\",\n\"ACCURACY\", \"CONSISTENCY\", \"VALIDITY\", \"UNIQUENESS\", \"FRESHNESS\",\n\"VOLUME\"\\]**\n\n### IgnoreNull\n\n public bool IgnoreNull { get; set; }\n\nOptional. Rows with `null` values will automatically fail a rule, unless\n`ignore_null` is `true`. In that case, such `null` rows are trivially\nconsidered passing.\n\nThis field is only valid for the following type of rules:\n\n- RangeExpectation\n- RegexExpectation\n- SetExpectation\n- UniquenessExpectation\n\n### Name\n\n public string Name { get; set; }\n\nOptional. A mutable name for the rule.\n\n- The name must contain only letters (a-z, A-Z), numbers (0-9), or hyphens (-).\n- The maximum length is 63 characters.\n- Must start with a letter.\n- Must end with a number or a letter.\n\n### NonNullExpectation\n\n public DataQualityRule.Types.NonNullExpectation NonNullExpectation { get; set; }\n\nRow-level rule which evaluates whether each column value is null.\n\n### RangeExpectation\n\n public DataQualityRule.Types.RangeExpectation RangeExpectation { get; set; }\n\nRow-level rule which evaluates whether each column value lies between a\nspecified range.\n\n### RegexExpectation\n\n public DataQualityRule.Types.RegexExpectation RegexExpectation { get; set; }\n\nRow-level rule which evaluates whether each column value matches a\nspecified regex.\n\n### RowConditionExpectation\n\n public DataQualityRule.Types.RowConditionExpectation RowConditionExpectation { get; set; }\n\nRow-level rule which evaluates whether each row in a table passes the\nspecified condition.\n\n### RuleTypeCase\n\n public DataQualityRule.RuleTypeOneofCase RuleTypeCase { get; }\n\n### SetExpectation\n\n public DataQualityRule.Types.SetExpectation SetExpectation { get; set; }\n\nRow-level rule which evaluates whether each column value is contained by\na specified set.\n\n### SqlAssertion\n\n public DataQualityRule.Types.SqlAssertion SqlAssertion { get; set; }\n\nAggregate rule which evaluates the number of rows returned for the\nprovided statement. If any rows are returned, this rule fails.\n\n### StatisticRangeExpectation\n\n public DataQualityRule.Types.StatisticRangeExpectation StatisticRangeExpectation { get; set; }\n\nAggregate rule which evaluates whether the column aggregate\nstatistic lies between a specified range.\n\n### Suspended\n\n public bool Suspended { get; set; }\n\nOptional. Whether the Rule is active or suspended.\nDefault is false.\n\n### TableConditionExpectation\n\n public DataQualityRule.Types.TableConditionExpectation TableConditionExpectation { get; set; }\n\nAggregate rule which evaluates whether the provided expression is true\nfor a table.\n\n### Threshold\n\n public double Threshold { get; set; }\n\nOptional. The minimum ratio of **passing_rows / total_rows** required to\npass this rule, with a range of \\[0.0, 1.0\\].\n\n0 indicates default value (i.e. 1.0).\n\nThis field is only valid for row-level type rules.\n\n### UniquenessExpectation\n\n public DataQualityRule.Types.UniquenessExpectation UniquenessExpectation { get; set; }\n\nRow-level rule which evaluates whether each column value is unique."]]