{
  "type": "record",
  "name": "DatasetProfile",
  "namespace": "com.linkedin.pegasus2avro.dataset",
  "doc": "Stats corresponding to datasets",
  "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": [
        "null",
        {
          "type": "record",
          "name": "PartitionSpec",
          "namespace": "com.linkedin.pegasus2avro.timeseries",
          "doc": "Defines how the data is partitioned",
          "fields": [
            {
              "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
            }
          ]
        }
      ],
      "doc": "The optional partition specification.",
      "default": null
    },
    {
      "name": "rowCount",
      "type": [
        "null",
        "long"
      ],
      "default": null
    },
    {
      "name": "columnCount",
      "type": [
        "null",
        "long"
      ],
      "default": null
    },
    {
      "name": "fieldProfiles",
      "type": [
        "null",
        {
          "type": "array",
          "items": {
            "type": "record",
            "name": "DatasetFieldProfile",
            "doc": "Stats corresponding to fields in a dataset",
            "fields": [
              {
                "name": "fieldPath",
                "type": "string"
              },
              {
                "name": "uniqueCount",
                "type": [
                  "null",
                  "long"
                ],
                "default": null
              },
              {
                "name": "uniqueProportion",
                "type": [
                  "null",
                  "float"
                ],
                "default": null
              },
              {
                "name": "nullCount",
                "type": [
                  "null",
                  "long"
                ],
                "default": null
              },
              {
                "name": "nullProportion",
                "type": [
                  "null",
                  "float"
                ],
                "default": null
              },
              {
                "name": "min",
                "type": [
                  "null",
                  "string"
                ],
                "default": null
              },
              {
                "name": "max",
                "type": [
                  "null",
                  "string"
                ],
                "default": null
              },
              {
                "name": "mean",
                "type": [
                  "null",
                  "string"
                ],
                "default": null
              },
              {
                "name": "median",
                "type": [
                  "null",
                  "string"
                ],
                "default": null
              },
              {
                "name": "stdev",
                "type": [
                  "null",
                  "string"
                ],
                "default": null
              },
              {
                "name": "quantiles",
                "type": [
                  "null",
                  {
                    "type": "array",
                    "items": {
                      "type": "record",
                      "name": "Quantile",
                      "fields": [
                        {
                          "name": "quantile",
                          "type": "string"
                        },
                        {
                          "name": "value",
                          "type": "string"
                        }
                      ]
                    }
                  }
                ],
                "default": null
              },
              {
                "name": "distinctValueFrequencies",
                "type": [
                  "null",
                  {
                    "type": "array",
                    "items": {
                      "type": "record",
                      "name": "ValueFrequency",
                      "fields": [
                        {
                          "name": "value",
                          "type": "string"
                        },
                        {
                          "name": "frequency",
                          "type": "long"
                        }
                      ]
                    }
                  }
                ],
                "default": null
              },
              {
                "name": "histogram",
                "type": [
                  "null",
                  {
                    "type": "record",
                    "name": "Histogram",
                    "fields": [
                      {
                        "name": "boundaries",
                        "type": {
                          "type": "array",
                          "items": "string"
                        }
                      },
                      {
                        "name": "heights",
                        "type": {
                          "type": "array",
                          "items": "float"
                        }
                      }
                    ]
                  }
                ],
                "default": null
              },
              {
                "name": "sampleValues",
                "type": [
                  "null",
                  {
                    "type": "array",
                    "items": "string"
                  }
                ],
                "default": null
              }
            ]
          }
        }
      ],
      "default": null
    }
  ],
  "Aspect": {
    "name": "datasetProfile",
    "type": "timeseries"
  }
}