{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Definition",
  "type": "object",
  "properties": {
    "workspace": {
      "description": "A workspace definition",
      "anyOf": [
        {
          "$ref": "#/definitions/Workspace"
        },
        {
          "type": "null"
        }
      ]
    },
    "profile": {
      "description": "A profile definition",
      "anyOf": [
        {
          "$ref": "#/definitions/Profile"
        },
        {
          "type": "null"
        }
      ]
    },
    "table": {
      "description": "A table definition",
      "anyOf": [
        {
          "$ref": "#/definitions/Table"
        },
        {
          "type": "null"
        }
      ]
    },
    "classifier": {
      "description": "A classifier definition",
      "anyOf": [
        {
          "$ref": "#/definitions/Classifier"
        },
        {
          "type": "null"
        }
      ]
    },
    "function": {
      "description": "A function definition",
      "anyOf": [
        {
          "$ref": "#/definitions/Function"
        },
        {
          "type": "null"
        }
      ]
    },
    "plugin": {
      "description": "A plugin definition",
      "anyOf": [
        {
          "$ref": "#/definitions/Plugin"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "additionalProperties": false,
  "definitions": {
    "Workspace": {
      "description": "A workspace is a collection of one or more catalogs, schemas, tables, and resources, called workspace members, that are managed together.",
      "type": "object",
      "required": [
        "edition",
        "name"
      ],
      "properties": {
        "edition": {
          "description": "The SDF edition, should always be 1 (for now)",
          "type": "string"
        },
        "name": {
          "description": "The name of this workspace (defaults to the workspace directory name if not given) Name must be set for deployment.",
          "type": "string"
        },
        "description": {
          "description": "A description of this workspace",
          "type": [
            "string",
            "null"
          ]
        },
        "repository": {
          "description": "The URL of the workspace source repository [defaults to 'none' if no repository is given]",
          "type": [
            "string",
            "null"
          ]
        },
        "remote-location": {
          "description": "The default output object store location, e.g. 's3://bucket/key/' where key is optional",
          "type": [
            "string",
            "null"
          ]
        },
        "includes": {
          "description": "An array of directories and filenames containing .sql and .sdf.yml files",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/IncludePath"
          }
        },
        "excludes": {
          "description": "An array of directories and filenames to be skipped when resolving includes",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/FilePath"
          }
        },
        "references": {
          "description": "An array of paths to other workspaces, i.e. .sql and .yml files",
          "writeOnly": true,
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/WorkspacePath"
          }
        },
        "dialect": {
          "description": "The dialect of this workspace. If not set, defaults to sdf dialect",
          "anyOf": [
            {
              "$ref": "#/definitions/Dialect"
            },
            {
              "type": "null"
            }
          ]
        },
        "resources": {
          "description": "An array of paths to directories and files, which will be copied to the SDF service on deployment",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/FilePath"
          }
        },
        "default-catalog": {
          "description": "Defines a default catalog [If not set, defaults to the directory of the workspace]",
          "type": [
            "string",
            "null"
          ]
        },
        "default-schema": {
          "description": "Defines a default schema [If not set, defaults to 'pub']",
          "type": [
            "string",
            "null"
          ]
        },
        "default-profile": {
          "description": "Defines the default profile [if not set, defaults to 'dbg']",
          "type": [
            "string",
            "null"
          ]
        },
        "source-locations": {
          "description": "Workspace defined by these set of files",
          "anyOf": [
            {
              "$ref": "#/definitions/FilePath"
            },
            {
              "type": "null"
            }
          ]
        },
        "variables": {
          "description": "An array of named values for setting SQL variables from your environment Ex. -dt: dt, used in SQL as @dt",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/Variable"
          }
        },
        "code-reports": {
          "description": "An array of queries over the information schema that will be run on sdf describe and sdf deploy",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/CodeReportPath"
          }
        },
        "code-checks": {
          "description": "An array of queries over the information schema that will be run on sdf describe and sdf deploy",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/CodeCheckPath"
          }
        },
        "access-control": {
          "description": "An array of attribute based access control queries over the information schema, current user and current job, that will be run on sdf build and sdf deploy",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/AccessControlPath"
          }
        }
      },
      "additionalProperties": false
    },
    "IncludePath": {
      "description": "All file path should either be relative to the workspace, or absolute for an object store like AWS s3:// Note that an [IncludePath] specifies a catalog and schema scope for unqualified names (in effect for both creating and querying tables). See [IncludePath::default_catalog] and [IncludePath::default_schema].",
      "type": "object",
      "required": [
        "path"
      ],
      "properties": {
        "path": {
          "description": "A filepath",
          "type": "string"
        },
        "default-catalog": {
          "description": "Defines a default catalog for unqualified names. If not set, defaults to the [Workspace] catalog.",
          "type": [
            "string",
            "null"
          ]
        },
        "default-schema": {
          "description": "Defines a default schema for unqualified names. If not set, defaults to the [Workspace] schema.",
          "type": [
            "string",
            "null"
          ]
        },
        "dialect": {
          "description": "The dialect of the included files. If not set, defaults to the [Workspace] dialect.",
          "anyOf": [
            {
              "$ref": "#/definitions/Dialect"
            },
            {
              "type": "null"
            }
          ]
        },
        "time": {
          "description": "Last modified of the file",
          "writeOnly": true,
          "anyOf": [
            {
              "$ref": "#/definitions/SystemTime"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "Dialect": {
      "type": "string",
      "enum": [
        "sdf",
        "presto",
        "bigquery",
        "redshift"
      ]
    },
    "SystemTime": {
      "type": "object",
      "required": [
        "nanos_since_epoch",
        "secs_since_epoch"
      ],
      "properties": {
        "secs_since_epoch": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0.0
        },
        "nanos_since_epoch": {
          "type": "integer",
          "format": "uint32",
          "minimum": 0.0
        }
      }
    },
    "FilePath": {
      "description": "All file path should either be relative to the workspace, or absolute for an object store like AWS s3://",
      "type": "object",
      "required": [
        "path"
      ],
      "properties": {
        "path": {
          "description": "A filepath",
          "type": "string"
        },
        "time": {
          "description": "Last modified of the file",
          "writeOnly": true,
          "anyOf": [
            {
              "$ref": "#/definitions/SystemTime"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "WorkspacePath": {
      "type": "object",
      "required": [
        "branch",
        "git",
        "path",
        "rev"
      ],
      "properties": {
        "path": {
          "description": "The relative path from this workspace to the referenced workspace, for a Git repo, from the root of the depot to the workspace",
          "type": "string"
        },
        "git": {
          "description": "The Git repo",
          "type": "string"
        },
        "rev": {
          "description": "the Git revision",
          "type": "string"
        },
        "branch": {
          "description": "the Git branch",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "Variable": {
      "description": "SQL queries can be parameterized via variables of type varchar. A variable definition binds the variable to the provided value.",
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "description": "The name of the variable",
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "value": {
          "description": "The value of this variable (using sql/yaml literals)",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "CodeReportPath": {
      "type": "object",
      "required": [
        "name",
        "path"
      ],
      "properties": {
        "path": {
          "description": "A filepath",
          "type": "string"
        },
        "name": {
          "description": "Name of check (default filestem of path)",
          "type": "string"
        },
        "description": {
          "description": "A description of this report",
          "type": [
            "string",
            "null"
          ]
        },
        "dialect": {
          "description": "dialect",
          "anyOf": [
            {
              "$ref": "#/definitions/Dialect"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "CodeCheckPath": {
      "type": "object",
      "required": [
        "assert",
        "path"
      ],
      "properties": {
        "assert": {
          "description": "Assertion",
          "allOf": [
            {
              "$ref": "#/definitions/CodeAssertion"
            }
          ]
        },
        "name": {
          "description": "Name of check (default filestem of path)",
          "type": [
            "string",
            "null"
          ]
        },
        "path": {
          "description": "A filepath",
          "type": "string"
        },
        "description": {
          "description": "A description of this assertion",
          "type": [
            "string",
            "null"
          ]
        },
        "dialect": {
          "description": "dialect",
          "anyOf": [
            {
              "$ref": "#/definitions/Dialect"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "CodeAssertion": {
      "type": "string",
      "enum": [
        "exists",
        "not-exists"
      ]
    },
    "AccessControlPath": {
      "type": "object",
      "required": [
        "access",
        "name",
        "path"
      ],
      "properties": {
        "access": {
          "description": "Grant access",
          "allOf": [
            {
              "$ref": "#/definitions/Grant"
            }
          ]
        },
        "name": {
          "description": "Name of check (default filestem of path)",
          "type": "string"
        },
        "description": {
          "description": "A description of this access control rule",
          "type": [
            "string",
            "null"
          ]
        },
        "path": {
          "description": "A filepath to a policy authored in .sql",
          "type": "string"
        },
        "time": {
          "writeOnly": true,
          "anyOf": [
            {
              "$ref": "#/definitions/SystemTime"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "Grant": {
      "type": "string",
      "enum": [
        "deny",
        "allow"
      ]
    },
    "Profile": {
      "description": "Profiles provide a way to override the fields of a workspace, i.e. if a profile has set field X, then the workspace field X will be overridden by the profile field X.",
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "description": "A description of this workspace",
          "type": [
            "string",
            "null"
          ]
        },
        "remote-location": {
          "description": "The default output object store location, e.g. 's3://bucket/key/' where key is optional",
          "type": [
            "string",
            "null"
          ]
        },
        "includes": {
          "description": "An array of directories and filenames containing .sql and .sdf.yml files",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/IncludePath"
          }
        },
        "excludes": {
          "description": "An array of directories and filenames to be skipped when resolving includes",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/FilePath"
          }
        },
        "references": {
          "description": "An array of paths to other workspaces, i.e. .sql and .yml files",
          "writeOnly": true,
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/WorkspacePath"
          }
        },
        "dialect": {
          "description": "The default dialect of this workspace. If not set, defaults to sdf dialect",
          "anyOf": [
            {
              "$ref": "#/definitions/Dialect"
            },
            {
              "type": "null"
            }
          ]
        },
        "resources": {
          "description": "An array of paths to directories and files, which will be copied to the SDF service on deployment",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/FilePath"
          }
        },
        "default-catalog": {
          "description": "Defines a default catalog [If not set, defaults to the directory of the workspace]",
          "type": [
            "string",
            "null"
          ]
        },
        "default-schema": {
          "description": "Defines a default schema [If not set, defaults to 'pub']",
          "type": [
            "string",
            "null"
          ]
        },
        "source-locations": {
          "description": "Workspace defined by these set of files",
          "anyOf": [
            {
              "$ref": "#/definitions/FilePath"
            },
            {
              "type": "null"
            }
          ]
        },
        "variables": {
          "description": "An array of named values for setting SQL variables from your environment Ex. -dt: dt, used in SQL as @dt",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/Variable"
          }
        },
        "code-reports": {
          "description": "An array of queries over the information schema that will be run on sdf describe and sdf deploy",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/CodeReportPath"
          }
        },
        "code-checks": {
          "description": "An array of queries over the information schema that will be run on sdf describe and sdf deploy",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/CodeCheckPath"
          }
        },
        "access-control": {
          "description": "An array of attribute based access control queries over the information schema, current user and current job, that will be run on sdf build and sdf deploy",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/AccessControlPath"
          }
        }
      },
      "additionalProperties": false
    },
    "Table": {
      "description": "A tables is either defined by given data (also called external table) or defined via a query.",
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "dialect": {
          "description": "An array of sql file names [Typically inferred]",
          "anyOf": [
            {
              "$ref": "#/definitions/Dialect"
            },
            {
              "type": "null"
            }
          ]
        },
        "dependencies": {
          "description": "ALl table dependencies (syntax: catalog.schema.table)",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "columns": {
          "description": "The columns of the schema: name, type, metadata",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/Column"
          }
        },
        "partitioned-by": {
          "description": "The partitioning format of the table",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/Partition"
          }
        },
        "schedule": {
          "description": "The schedule of the table [expressed as cron]",
          "type": [
            "string",
            "null"
          ]
        },
        "starting": {
          "description": "The first date of the table [expressed by prefixes of RFC 33]",
          "type": [
            "string",
            "null"
          ]
        },
        "classifiers": {
          "description": "An array of classifier references",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "reclassify": {
          "description": "Array of reclassify instructions for changing the attached classifier labels",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/Reclassify"
          }
        },
        "lineage": {
          "description": "Lineage, a tagged array of column references",
          "anyOf": [
            {
              "$ref": "#/definitions/Lineage"
            },
            {
              "type": "null"
            }
          ]
        },
        "materialization": {
          "description": "The materialization scheme of this table",
          "anyOf": [
            {
              "$ref": "#/definitions/Materialization"
            },
            {
              "type": "null"
            }
          ]
        },
        "insert-into": {
          "description": "Store data under this catalog.schema.table instead of the original name",
          "type": [
            "string",
            "null"
          ]
        },
        "location": {
          "description": "Data is at this location",
          "type": [
            "string",
            "null"
          ]
        },
        "file-format": {
          "description": "Store table in this format [only for external tables]",
          "anyOf": [
            {
              "$ref": "#/definitions/FileFormat"
            },
            {
              "type": "null"
            }
          ]
        },
        "with-header": {
          "description": "CSV data has a header [only for external tables]",
          "type": [
            "boolean",
            "null"
          ]
        },
        "delimiter": {
          "description": "CSV data is separated by this delimiter [only for external tables]",
          "type": [
            "string",
            "null"
          ]
        },
        "compression": {
          "description": "Json or CSV data is compressed with this method [only for external tables]",
          "anyOf": [
            {
              "$ref": "#/definitions/CompressionType"
            },
            {
              "type": "null"
            }
          ]
        },
        "source-locations": {
          "description": "Table is defined by these .sql and/or .sdf files",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/FilePath"
          }
        }
      },
      "additionalProperties": false
    },
    "Column": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "description": "The name of the column",
          "type": "string"
        },
        "description": {
          "description": "A description of this column",
          "type": [
            "string",
            "null"
          ]
        },
        "datatype": {
          "description": "The type of this column",
          "type": [
            "string",
            "null"
          ]
        },
        "nullable": {
          "description": "The type of this column",
          "type": [
            "boolean",
            "null"
          ]
        },
        "classifiers": {
          "description": "An array of classifier references",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "lineage": {
          "description": "Lineage, a tagged array of column references",
          "anyOf": [
            {
              "$ref": "#/definitions/Lineage"
            },
            {
              "type": "null"
            }
          ]
        },
        "reclassify": {
          "description": "Array of reclassify instructions for changing the attached classifier labels",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/Reclassify"
          }
        }
      },
      "additionalProperties": false
    },
    "Lineage": {
      "type": "object",
      "properties": {
        "copy": {
          "description": "The output column is computed by copying these upstream columns",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "modify": {
          "description": "The output column is computed by transforming these upstream columns",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "scan": {
          "description": "These upstream columns are indirectly used to produce the output (e.g. in WHERE or GROUP BY)",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "apply": {
          "description": "These functions were used to produce the output column",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "Reclassify": {
      "type": "object",
      "properties": {
        "to": {
          "description": "Target classifier",
          "type": [
            "string",
            "null"
          ]
        },
        "from": {
          "description": "Expected source classifier",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "Partition": {
      "description": "A partition is a table column, used to describe to which partition this row belongs to",
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "description": "The name of the partition column",
          "type": "string"
        },
        "description": {
          "description": "A description of the partition column",
          "type": [
            "string",
            "null"
          ]
        },
        "format": {
          "description": "The format of the partition column [use strftime format for date/time] See (guide)[https://docs.sdf.com/guide/schedules]",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "Materialization": {
      "oneOf": [
        {
          "description": "All derived tables are cached by default",
          "type": "string",
          "enum": [
            "cached"
          ]
        },
        {
          "description": "External tables must be explicitly marked When using 'Create external table` SQL syntax",
          "type": "string",
          "enum": [
            "external"
          ]
        },
        {
          "description": "View",
          "type": "string",
          "enum": [
            "view"
          ]
        },
        {
          "description": "Ephemeral",
          "type": "string",
          "enum": [
            "ephemeral"
          ]
        },
        {
          "description": "Recursive warehouse tables must be  explicitly  marked",
          "type": "string",
          "enum": [
            "recursive"
          ]
        }
      ]
    },
    "FileFormat": {
      "description": "Store table data in these formats",
      "type": "string",
      "enum": [
        "parquet",
        "csv",
        "json"
      ]
    },
    "CompressionType": {
      "description": "Compress table data using these methods",
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "tar",
            "zstd"
          ]
        },
        {
          "description": "BZIP2 Compression (.bz2)",
          "type": "string",
          "enum": [
            "bzip2"
          ]
        },
        {
          "description": "GZIP Compression (.gzip)",
          "type": "string",
          "enum": [
            "gzip"
          ]
        },
        {
          "description": "None, (default)",
          "type": "string",
          "enum": [
            "none"
          ]
        }
      ]
    },
    "Classifier": {
      "description": "A classifier defines the labels that can be attached to columns or a table.",
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "description": "The name of the classifier type",
          "type": "string"
        },
        "description": {
          "description": "A description of this classifier type",
          "type": [
            "string",
            "null"
          ]
        },
        "labels": {
          "description": "Named classifier labels",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/Label"
          }
        },
        "scope": {
          "description": "scope of the classifier: table or column",
          "anyOf": [
            {
              "$ref": "#/definitions/Scope"
            },
            {
              "type": "null"
            }
          ]
        },
        "cardinality": {
          "description": "cardinality of the classifier: zero-or-one, one or zero-or-many",
          "anyOf": [
            {
              "$ref": "#/definitions/Cardinality"
            },
            {
              "type": "null"
            }
          ]
        },
        "propagate": {
          "description": "does the classifier propagate from scope to scope or is it a one scope marker",
          "type": [
            "boolean",
            "null"
          ]
        },
        "source-locations": {
          "description": "Classifier defined by these set of .sdf files",
          "anyOf": [
            {
              "$ref": "#/definitions/FilePath"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "Label": {
      "description": "A classifier element is a scoped classifier label (e.g. the element PII belongs to the classifier scope data)",
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "description": "The name of the label, use \"*\" to allow arbitrary strings as labels",
          "type": "string"
        },
        "description": {
          "description": "A description of this classifier element",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "Scope": {
      "type": "string",
      "enum": [
        "column",
        "table"
      ]
    },
    "Cardinality": {
      "type": "string",
      "enum": [
        "zero-or-one",
        "one",
        "zero-or-more"
      ]
    },
    "Function": {
      "description": "A function block defines the signature for user defined",
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "description": "The name of the function [syntax: [[catalog.]schema].function]",
          "type": "string"
        },
        "section": {
          "description": "The generic type bounds",
          "type": [
            "string",
            "null"
          ]
        },
        "dialect": {
          "description": "The dialect that provides this function",
          "anyOf": [
            {
              "$ref": "#/definitions/Dialect"
            },
            {
              "type": "null"
            }
          ]
        },
        "description": {
          "description": "A description of this function",
          "type": [
            "string",
            "null"
          ]
        },
        "variadic": {
          "description": "Arbitrary number of arguments of an common type out of a list of valid types",
          "anyOf": [
            {
              "$ref": "#/definitions/Variadic"
            },
            {
              "type": "null"
            }
          ]
        },
        "kind": {
          "description": "The function kind",
          "anyOf": [
            {
              "$ref": "#/definitions/FunctionKind"
            },
            {
              "type": "null"
            }
          ]
        },
        "parameters": {
          "description": "The arguments of this function",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/Parameter"
          }
        },
        "optional-parameters": {
          "description": "The arguments of this function",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/OptionalParameter"
          }
        },
        "returns": {
          "description": "The results of this function (can be a tuple)",
          "anyOf": [
            {
              "$ref": "#/definitions/Parameter"
            },
            {
              "type": "null"
            }
          ]
        },
        "binds": {
          "description": "The generic type bounds",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/TypeBound"
          }
        },
        "volatility": {
          "description": "volatility - The volatility of the function.",
          "anyOf": [
            {
              "$ref": "#/definitions/Volatility"
            },
            {
              "type": "null"
            }
          ]
        },
        "examples": {
          "description": "example - Example use of the function (tuple with input/output)",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/Example"
          }
        },
        "cross-link": {
          "description": "cross-link - link to existing documentation, for example: https://prestodb.io/docs/current/functions/datetime.html#truncation-function",
          "type": [
            "string",
            "null"
          ]
        },
        "reclassify": {
          "description": "Array of reclassify instructions for changing the attached classifier labels",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/Reclassify"
          }
        },
        "source-locations": {
          "description": "Function defined by these set of .sdf files",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/FilePath"
          }
        }
      },
      "additionalProperties": false
    },
    "Variadic": {
      "description": "Arbitrary number of arguments of an common type out of a list of valid types",
      "oneOf": [
        {
          "description": "All arguments have the same types",
          "type": "string",
          "enum": [
            "uniform"
          ]
        },
        {
          "description": "All even arguments have one type, odd arguments have another type",
          "type": "string",
          "enum": [
            "even-odd"
          ]
        }
      ]
    },
    "FunctionKind": {
      "type": "string",
      "enum": [
        "scalar",
        "aggregate",
        "window"
      ]
    },
    "Parameter": {
      "description": "A function parameter",
      "type": "object",
      "properties": {
        "name": {
          "description": "The name of the parameter",
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "description": "A description of this parameter",
          "type": [
            "string",
            "null"
          ]
        },
        "datatype": {
          "description": "The datatype of this parameter",
          "type": [
            "string",
            "null"
          ]
        },
        "nullable": {
          "description": "The nullability of this column",
          "type": [
            "boolean",
            "null"
          ]
        },
        "classifier": {
          "description": "An array of classifier references",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "constant": {
          "description": "The required constant value of this parameter",
          "type": [
            "string",
            "null"
          ]
        },
        "identifiers": {
          "description": "The parameter may appear as identifier, without quote",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "OptionalParameter": {
      "description": "A function parameter",
      "type": "object",
      "required": [
        "datatype",
        "name"
      ],
      "properties": {
        "name": {
          "description": "The name of the parameter",
          "type": "string"
        },
        "description": {
          "description": "A description of this parameter",
          "type": [
            "string",
            "null"
          ]
        },
        "datatype": {
          "description": "The datatype of this parameter",
          "type": "string"
        },
        "classifier": {
          "description": "An array of classifier references",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "constant": {
          "description": "The required constant value of this parameter",
          "type": [
            "string",
            "null"
          ]
        },
        "identifiers": {
          "description": "The parameter may appear as identifier, without quote",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "TypeBound": {
      "type": "object",
      "required": [
        "datatypes",
        "type-variable"
      ],
      "properties": {
        "type-variable": {
          "type": "string"
        },
        "datatypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "Volatility": {
      "description": "A function's volatility, which defines the functions eligibility for certain optimizations",
      "oneOf": [
        {
          "description": "Pure - An pure function will always return the same output when given the same input.",
          "type": "string",
          "enum": [
            "pure"
          ]
        },
        {
          "description": "Stable - A stable function may return different values given the same input across different queries but must return the same value for a given input within a query.",
          "type": "string",
          "enum": [
            "stable"
          ]
        },
        {
          "description": "Volatile - A volatile function may change the return value from evaluation to evaluation. Multiple invocations of a volatile function may return different results when used in the same query.",
          "type": "string",
          "enum": [
            "volatile"
          ]
        }
      ]
    },
    "Example": {
      "type": "object",
      "required": [
        "input",
        "output"
      ],
      "properties": {
        "input": {
          "description": "The sql string corresponding to the input of this example",
          "type": "string"
        },
        "output": {
          "description": "The output corresponding to running the input string",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "Plugin": {
      "description": "A function block defines the signature for user defined",
      "type": "object",
      "required": [
        "binary",
        "extension",
        "format",
        "name"
      ],
      "properties": {
        "name": {
          "description": "The name of the plugin [e.g.: pyspark]",
          "type": "string"
        },
        "binary": {
          "description": "Full path to the binary [e.g.: /usr/bin/python3]",
          "type": "string"
        },
        "extension": {
          "description": "File extension to scan in the includes directories; must be unique [e.g.: .py]",
          "type": "string"
        },
        "format": {
          "description": "Format of the output files; must be known to SDF [e.g.: spark-lp-json]",
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  }
}