{
  "type": "record",
  "name": "Operation",
  "namespace": "com.linkedin.pegasus2avro.common",
  "doc": "Operational info for an entity.",
  "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": "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": "lastUpdatedTimestamp",
      "type": "long",
      "doc": "When the entity was last updated.",
      "TimeseriesField": {}
    },
    {
      "name": "actor",
      "type": [
        "null",
        "string"
      ],
      "doc": "Actor who issued this operation.",
      "default": null,
      "TimeseriesField": {},
      "java": {
        "class": "com.linkedin.pegasus2avro.common.urn.Urn"
      }
    },
    {
      "name": "operationType",
      "type": {
        "type": "enum",
        "name": "OperationType",
        "doc": "Enum to define the operation type when an entity changes.",
        "symbols": [
          "INSERT",
          "UPDATE",
          "DELETE",
          "CREATE",
          "DROP",
          "UNKNOWN"
        ]
      },
      "doc": "Operation type of change.",
      "TimeseriesField": {}
    },
    {
      "name": "numAffectedRows",
      "type": [
        "null",
        "long"
      ],
      "doc": "How many rows were affected by this operation.",
      "default": null,
      "TimeseriesField": {}
    },
    {
      "name": "affectedDatasets",
      "type": [
        "null",
        {
          "type": "array",
          "items": "string"
        }
      ],
      "doc": "Which other datasets were affected by this operation.",
      "default": null,
      "TimeseriesFieldCollection": {
        "key": "datasetName"
      }
    }
  ],
  "Aspect": {
    "name": "operation",
    "type": "timeseries"
  }
}