{
  "$id": "https://opendatafabric.org/schemas/datasets/v1alpha1/AddData",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Indicates that data has been ingested into a root dataset.",
  "type": "object",
  "required": [],
  "properties": {
    "prevCheckpoint": {
      "type": "string",
      "format": "multihash",
      "description": "Hash of the checkpoint file used to restore ingestion state, if any."
    },
    "prevOffset": {
      "type": "integer",
      "format": "uint64",
      "description": "Last offset of the previous data slice, if any. Must be equal to the last non-empty `newData.offsetInterval.end`."
    },
    "newData": {
      "$ref": "https://opendatafabric.org/schemas/datasets/v1alpha1/DataSlice",
      "description": "Describes output data written during this transaction, if any.",
      "unevaluatedProperties": false
    },
    "newCheckpoint": {
      "$ref": "https://opendatafabric.org/schemas/datasets/v1alpha1/Checkpoint",
      "description": "Describes checkpoint written during this transaction, if any. If an engine operation resulted in no updates to the checkpoint, but checkpoint is still relevant for subsequent runs - a hash of the previous checkpoint should be specified.",
      "unevaluatedProperties": false
    },
    "newWatermark": {
      "type": "string",
      "format": "date-time",
      "description": "Last watermark of the output data stream, if any. Initial blocks may not have watermarks, but once watermark is set - all subsequent blocks should either carry the same watermark or specify a new (greater) one. Thus, watermarks are monotonically non-decreasing."
    },
    "newSourceState": {
      "$ref": "https://opendatafabric.org/schemas/sources/v1alpha1/SourceState",
      "description": "The state of the source the data was added from to allow fast resuming. If the state did not change but is still relevant for subsequent runs it should be carried, i.e. only the last state per source is considered when resuming.",
      "unevaluatedProperties": false
    },
    "extra": {
      "$ref": "https://opendatafabric.org/schemas/data/v1alpha1/ExtraAttributes",
      "description": "ODF extensions.",
      "unevaluatedProperties": false
    }
  }
}
