{
  "type": "record",
  "name": "AssertionRunEvent",
  "namespace": "com.linkedin.pegasus2avro.assertion",
  "doc": "An event representing the current status of evaluating an assertion on a batch.\nAssertionRunEvent should be used for reporting the status of a run as an assertion evaluation progresses.",
  "fields": [
    {
      "name": "timestampMillis",
      "type": "long",
      "doc": "The event timestamp field as epoch at UTC in milli seconds."
    },
    {
      "name": "eventGranularity",
      "type": [
        "null",
        {
          "type": "record",
          "name": "TimeWindowSize",
          "namespace": "com.linkedin.pegasus2avro.timeseries",
          "doc": "Defines the size of a time window.",
          "fields": [
            {
              "name": "unit",
              "type": {
                "type": "enum",
                "name": "CalendarInterval",
                "symbols": [
                  "SECOND",
                  "MINUTE",
                  "HOUR",
                  "DAY",
                  "WEEK",
                  "MONTH",
                  "QUARTER",
                  "YEAR"
                ]
              },
              "doc": "Interval unit such as minute/hour/day etc."
            },
            {
              "name": "multiple",
              "type": "int",
              "doc": "How many units. Defaults to 1.",
              "default": 1
            }
          ]
        }
      ],
      "doc": "Granularity of the event if applicable",
      "default": null
    },
    {
      "name": "partitionSpec",
      "type": [
        {
          "type": "record",
          "name": "PartitionSpec",
          "namespace": "com.linkedin.pegasus2avro.timeseries",
          "doc": "Defines how the data is partitioned",
          "fields": [
            {
              "name": "type",
              "type": {
                "type": "enum",
                "name": "PartitionType",
                "symbols": [
                  "FULL_TABLE",
                  "QUERY",
                  "PARTITION"
                ]
              },
              "default": "PARTITION"
            },
            {
              "name": "partition",
              "type": "string",
              "doc": "String representation of the partition"
            },
            {
              "name": "timePartition",
              "type": [
                "null",
                {
                  "type": "record",
                  "name": "TimeWindow",
                  "fields": [
                    {
                      "name": "startTimeMillis",
                      "type": "long",
                      "doc": "Start time as epoch at UTC."
                    },
                    {
                      "name": "length",
                      "type": "TimeWindowSize",
                      "doc": "The length of the window."
                    }
                  ]
                }
              ],
              "doc": "Time window of the partition if applicable",
              "default": null
            }
          ]
        },
        "null"
      ],
      "doc": "The optional partition specification.",
      "default": {
        "partition": "FULL_TABLE_SNAPSHOT",
        "type": "FULL_TABLE",
        "timePartition": null
      }
    },
    {
      "name": "messageId",
      "type": [
        "null",
        "string"
      ],
      "doc": "The optional messageId, if provided serves as a custom user-defined unique identifier for an aspect value.",
      "default": null
    },
    {
      "name": "runId",
      "type": "string",
      "doc": " Native (platform-specific) identifier for this run"
    },
    {
      "name": "assertionUrn",
      "type": "string",
      "TimeseriesField": {},
      "java": {
        "class": "com.linkedin.pegasus2avro.common.urn.Urn"
      }
    },
    {
      "name": "asserteeUrn",
      "type": "string",
      "TimeseriesField": {},
      "java": {
        "class": "com.linkedin.pegasus2avro.common.urn.Urn"
      }
    },
    {
      "name": "batchSpec",
      "type": [
        "null",
        {
          "type": "record",
          "name": "BatchSpec",
          "doc": "A batch on which certain operations, e.g. data quality evaluation, is done.",
          "fields": [
            {
              "name": "customProperties",
              "type": {
                "type": "map",
                "values": "string"
              },
              "doc": "Custom property bag.",
              "default": {},
              "Searchable": {
                "/*": {
                  "queryByDefault": true
                }
              }
            },
            {
              "name": "nativeBatchId",
              "type": [
                "null",
                "string"
              ],
              "doc": "The native identifier as specified by the system operating on the batch.",
              "default": null
            },
            {
              "name": "query",
              "type": [
                "null",
                "string"
              ],
              "doc": "A query that identifies a batch of data",
              "default": null
            },
            {
              "name": "limit",
              "type": [
                "null",
                "int"
              ],
              "doc": "Any limit to the number of rows in the batch, if applied",
              "default": null
            }
          ]
        }
      ],
      "doc": "Specification of the batch which this run is evaluating",
      "default": null
    },
    {
      "name": "status",
      "type": {
        "type": "enum",
        "name": "AssertionRunStatus",
        "symbols": [
          "COMPLETE"
        ],
        "symbolDocs": {
          "COMPLETE": "The Assertion Run has completed"
        }
      },
      "doc": "The status of the assertion run as per this timeseries event.",
      "TimeseriesField": {}
    },
    {
      "name": "result",
      "type": [
        "null",
        {
          "type": "record",
          "name": "AssertionResult",
          "doc": "The result of running an assertion",
          "fields": [
            {
              "name": "type",
              "type": {
                "type": "enum",
                "name": "AssertionResultType",
                "symbols": [
                  "SUCCESS",
                  "FAILURE"
                ],
                "symbolDocs": {
                  "FAILURE": " The Assertion Failed",
                  "SUCCESS": " The Assertion Succeeded"
                }
              },
              "doc": " The final result, e.g. either SUCCESS or FAILURE.",
              "TimeseriesField": {}
            },
            {
              "name": "rowCount",
              "type": [
                "null",
                "long"
              ],
              "doc": "Number of rows for evaluated batch",
              "default": null
            },
            {
              "name": "missingCount",
              "type": [
                "null",
                "long"
              ],
              "doc": "Number of rows with missing value for evaluated batch",
              "default": null
            },
            {
              "name": "unexpectedCount",
              "type": [
                "null",
                "long"
              ],
              "doc": "Number of rows with unexpected value for evaluated batch",
              "default": null
            },
            {
              "name": "actualAggValue",
              "type": [
                "null",
                "float"
              ],
              "doc": "Observed aggregate value for evaluated batch",
              "default": null
            },
            {
              "name": "nativeResults",
              "type": [
                "null",
                {
                  "type": "map",
                  "values": "string"
                }
              ],
              "doc": "Other results of evaluation",
              "default": null
            },
            {
              "name": "externalUrl",
              "type": [
                "null",
                "string"
              ],
              "doc": "URL where full results are available",
              "default": null
            }
          ]
        }
      ],
      "doc": "Results of assertion, present if the status is COMPLETE",
      "default": null
    },
    {
      "name": "runtimeContext",
      "type": [
        "null",
        {
          "type": "map",
          "values": "string"
        }
      ],
      "doc": "Runtime parameters of evaluation",
      "default": null
    }
  ],
  "Aspect": {
    "name": "assertionRunEvent",
    "type": "timeseries"
  }
}