{
  "$schema" : "https://json-schema.org/draft/2020-12/schema",
  "$id" : "https://voltdb.com/voltsp/schemas/sink/iceberg-table",
  "title" : "Iceberg-table Sink Configuration",
  "description" : "The `iceberg-table` sink is used to create entries in Iceberg catalog. The catalog is organised around tables.\nIceberg tables can only catalog files with Parquet, Orc or Avro content type.\nIf table is not yet created, the sink will create it.\n\nThe schema provided must match the schema used by the file creator.\n\nThis sink will try to group as many files into a single commit as available in a single batch.\nThis operation should be atomic and no other update to a table should be performed.\n\nNote: Updates to an Iceberg table should be performed only by a single worker.\nIceberg relies on optimistic concurrency control, which requires the catalog client to have the most recent table metadata when performing an append.\nIf another worker modifies the table concurrently, the local metadata becomes outdated and the operation may fail or be invalid.\nThis can lead to performance degradation.\n\nNote: Iceberg table updates should be triggered only after a new file has been successfully written to the designated cloud storage system (e.g., S3, GCS, Azure Blob, HDFS, etc.).\nAnd can be done in the background as a slow path.\n",
  "type" : "object",
  "properties" : {
    "iceberg-table" : {
      "type" : "object",
      "properties" : {
        "catalogResource" : {
          "description" : "Reference to the configured Iceberg catalog resource.",
          "anyOf" : [ {
            "type" : "string"
          }, {
            "$ref" : "resource-iceberg-catalog.schema.json#/properties/iceberg-catalog"
          } ]
        },
        "tableIdentifier" : {
          "type" : "string",
          "description" : "Specifies table's identifier for Iceberg catalog."
        },
        "tableSchema" : {
          "type" : "string",
          "description" : "Specifies table's schema."
        },
        "partitionSpec" : {
          "type" : "string",
          "description" : "Specifies table's partitioning. Default is `unpartitioned`"
        },
        "retry" : {
          "type" : "object",
          "properties" : {
            "retryCount" : {
              "type" : "integer",
              "description" : "How many times to retry before giving up.",
              "default" : "3",
              "minimum" : -2147483648,
              "maximum" : 2147483647
            }
          },
          "additionalProperties" : false
        },
        "exceptionHandler" : {
          "type" : "string",
          "description" : "Custom exception handler enabling interception of all errors related to this source."
        }
      },
      "required" : [ "catalogResource", "tableIdentifier", "tableSchema" ],
      "additionalProperties" : false
    }
  },
  "required" : [ "iceberg-table" ],
  "additionalProperties" : false
}
