{
  "type": "record",
  "name": "AssertionInfo",
  "namespace": "com.linkedin.pegasus2avro.assertion",
  "doc": "Information about an assertion",
  "fields": [
    {
      "name": "customProperties",
      "type": {
        "type": "map",
        "values": "string"
      },
      "doc": "Custom property bag.",
      "default": {},
      "Searchable": {
        "/*": {
          "queryByDefault": true
        }
      }
    },
    {
      "name": "externalUrl",
      "type": [
        "null",
        "string"
      ],
      "doc": "URL where the reference exist",
      "default": null,
      "java": {
        "class": "com.linkedin.pegasus2avro.common.url.Url",
        "coercerClass": "com.linkedin.pegasus2avro.common.url.UrlCoercer"
      }
    },
    {
      "name": "datasetFields",
      "type": [
        "null",
        {
          "type": "array",
          "items": "string"
        }
      ],
      "doc": "One or more dataset schema fields that are targeted by this assertion",
      "default": null,
      "Relationship": {
        "/*": {
          "entityTypes": [
            "schemaField"
          ],
          "name": "Asserts"
        }
      }
    },
    {
      "name": "datasets",
      "type": [
        "null",
        {
          "type": "array",
          "items": "string"
        }
      ],
      "doc": "One or more datasets that are targeted by this assertion",
      "default": null,
      "Relationship": {
        "/*": {
          "entityTypes": [
            "dataset"
          ],
          "name": "Asserts"
        }
      }
    },
    {
      "name": "assertionType",
      "type": {
        "type": "record",
        "name": "AssertionType",
        "doc": "Type of Assertion",
        "fields": [
          {
            "name": "scope",
            "type": {
              "type": "enum",
              "name": "AssertionScope",
              "symbols": [
                "DATASET_COLUMN",
                "DATASET_ROWS",
                "DATASET_SCHEMA",
                "CROSS_DATASET"
              ]
            },
            "doc": "Scope of Assertion"
          },
          {
            "name": "datasetColumnAssertion",
            "type": [
              "null",
              {
                "type": "record",
                "name": "DatasetColumnAssertion",
                "doc": "Assertion on column of a dataset",
                "fields": [
                  {
                    "name": "stdOperator",
                    "type": {
                      "type": "enum",
                      "name": "AssertionStdOperator",
                      "symbols": [
                        "BETWEEN",
                        "LESS_THAN",
                        "LESS_THAN_OR_EQUAL_TO",
                        "GREATER_THAN",
                        "GREATER_THAN_OR_EQUAL_TO",
                        "EQUAL_TO",
                        "NOT_NULL",
                        "CONTAIN",
                        "END_WITH",
                        "START_WITH",
                        "IN",
                        "_NATIVE_"
                      ],
                      "symbolDocs": {
                        "BETWEEN": "Value being asserted is between min_value and max_value",
                        "CONTAIN": "Value being asserted contains value",
                        "END_WITH": "Value being asserted ends with value",
                        "EQUAL_TO": "Value being asserted is equal to value",
                        "GREATER_THAN": "Value being asserted is greater than min_value",
                        "GREATER_THAN_OR_EQUAL_TO": "Value being asserted is greater than or equal to min_value",
                        "IN": "Value being asserted is one of the array values",
                        "LESS_THAN": "Value being asserted is less than max_value",
                        "LESS_THAN_OR_EQUAL_TO": "Value being asserted is less than or equal to max_value",
                        "NOT_NULL": "Value being asserted is not null",
                        "START_WITH": "Value being asserted starts with value",
                        "_NATIVE_": "Other"
                      }
                    },
                    "doc": "Standardized assertion operator"
                  },
                  {
                    "name": "nativeOperator",
                    "type": [
                      "null",
                      "string"
                    ],
                    "doc": "Native assertion operator",
                    "default": null
                  },
                  {
                    "name": "stdAggFunc",
                    "type": {
                      "type": "enum",
                      "name": "DatasetColumnStdAggFunc",
                      "symbols": [
                        "IDENTITY",
                        "MEAN",
                        "MEDIAN",
                        "UNIQUE_COUNT",
                        "UNIQUE_PROPOTION",
                        "NULL_COUNT",
                        "NULL_PROPORTION",
                        "STDDEV",
                        "MIN",
                        "MAX",
                        "_NATIVE_"
                      ],
                      "symbolDocs": {
                        "IDENTITY": "Assertion is applied on individual column value",
                        "MAX": "Assertion is applied on column std deviation",
                        "MEAN": "Assertion is applied on column mean ",
                        "MEDIAN": "Assertion is applied on column median",
                        "MIN": "Assertion is applied on column min",
                        "NULL_COUNT": "Assertion is applied on number of null values in column",
                        "NULL_PROPORTION": "Assertion is applied on proportion of null values in column",
                        "STDDEV": "Assertion is applied on column std deviation",
                        "UNIQUE_COUNT": "Assertion is applied on number of distinct values in column",
                        "UNIQUE_PROPOTION": "Assertion is applied on proportion of distinct values in column",
                        "_NATIVE_": "Other"
                      }
                    },
                    "doc": "Standardized aggrgation function applied on column values"
                  },
                  {
                    "name": "nativeAggFunc",
                    "type": [
                      "null",
                      "string"
                    ],
                    "doc": "Native aggrgation function applied on column values",
                    "default": null
                  }
                ]
              }
            ],
            "doc": "Assertion details for scope DATASET_COLUMN",
            "default": null
          },
          {
            "name": "datasetRowsAssertion",
            "type": [
              "null",
              {
                "type": "record",
                "name": "DatasetRowsAssertion",
                "doc": "Assertion on rows of a dataset",
                "fields": [
                  {
                    "name": "stdOperator",
                    "type": "AssertionStdOperator",
                    "doc": "Standardized assertion operator"
                  },
                  {
                    "name": "nativeOperator",
                    "type": [
                      "null",
                      "string"
                    ],
                    "doc": "Native assertion operator",
                    "default": null
                  },
                  {
                    "name": "stdAggFunc",
                    "type": {
                      "type": "enum",
                      "name": "DatasetRowsStdAggFunc",
                      "symbols": [
                        "ROW_COUNT",
                        "_NATIVE_"
                      ],
                      "symbolDocs": {
                        "ROW_COUNT": "Assertion is applied on number of rows",
                        "_NATIVE_": "Other"
                      }
                    },
                    "doc": "Standardized aggrgation function applied on rows"
                  },
                  {
                    "name": "nativeAggFunc",
                    "type": [
                      "null",
                      "string"
                    ],
                    "doc": "Native aggrgation function applied on rows",
                    "default": null
                  }
                ]
              }
            ],
            "doc": "Assertion details for scope DATASET_ROWS",
            "default": null
          },
          {
            "name": "datasetSchemaAssertion",
            "type": [
              "null",
              {
                "type": "record",
                "name": "DatasetSchemaAssertion",
                "doc": "Assertion on schema of a dataset",
                "fields": [
                  {
                    "name": "stdOperator",
                    "type": "AssertionStdOperator",
                    "doc": "Standardized assertion operator"
                  },
                  {
                    "name": "nativeOperator",
                    "type": [
                      "null",
                      "string"
                    ],
                    "doc": "Native assertion operator",
                    "default": null
                  },
                  {
                    "name": "stdAggFunc",
                    "type": {
                      "type": "enum",
                      "name": "DatasetSchemaStdAggFunc",
                      "symbols": [
                        "COLUMNS",
                        "COLUMN_COUNT",
                        "_NATIVE_"
                      ],
                      "symbolDocs": {
                        "COLUMNS": "Assertion is applied on all columns",
                        "COLUMN_COUNT": "Assertion is applied on number of columns",
                        "_NATIVE_": "Other"
                      }
                    },
                    "doc": "Standardized aggrgation function applied on rows"
                  },
                  {
                    "name": "nativeAggFunc",
                    "type": [
                      "null",
                      "string"
                    ],
                    "doc": "Native aggrgation function applied on rows",
                    "default": null
                  }
                ]
              }
            ],
            "doc": "Assertion details for scope DATASET_SCHEMA",
            "default": null
          }
        ]
      },
      "doc": "Type of assertion"
    },
    {
      "name": "assertionLogic",
      "type": [
        "null",
        "string"
      ],
      "default": null
    },
    {
      "name": "assertionParameters",
      "type": {
        "type": "map",
        "values": "string"
      },
      "doc": "Parameters required for the assertion. e.g. min_value, max_value, value, columns",
      "default": {}
    }
  ],
  "Aspect": {
    "name": "assertionInfo"
  }
}