substrait-validator 0.1.4

Substrait validator
Documentation
$id: http://substrait.io/schemas/simple_extensions
$schema: https://json-schema.org/draft/2020-12/schema
title: Simple Extensions
additionalProperties: false
type: object
properties:
  dependencies:
    # For reusing type classes and type variations from other extension files.
    # The keys are namespace identifiers that you can then use as dot-separated
    # prefix for type class and type variation names in functions and the base
    # type class for variations. The values must be extension URIs, following
    # the same format and conventions as those used in the proto plans.
    type: object
    patternProperties:
      "^[a-zA-Z_\\$][a-zA-Z0-9_\\$]*$":
        type: string
  types:
    type: array
    minItems: 1
    items:
      type: object
      additionalProperties: false
      required: [name]
      properties:
        name:
          type: string
        structure:
          $ref: "#/$defs/type"
        parameters: # parameter list for compound types
          $ref: "#/$defs/type_param_defs"
        variadic: # when set, last parameter may be specified one or more times
          type: boolean
  type_variations:
    type: array
    minItems: 1
    items:
      type: object
      additionalProperties: false
      required: [parent, name]
      properties:
        parent:
          $ref: "#/$defs/type"
        name:
          type: string
        description:
          type: string
        functions:
          type: string
          enum: [INHERITS, SEPARATE]
  scalar_functions:
    type: array
    items:
      $ref: "#/$defs/scalarFunction"
  aggregate_functions:
    type: array
    items:
      $ref: "#/$defs/aggregateFunction"
  window_functions:
    type: array
    items:
      $ref: "#/$defs/windowFunction"

$defs:
  type:
    oneOf:
      - type: string # any data type
      - type: object # syntactic sugar for a non-nullable named struct
  type_param_defs: # an array of compound type parameter definitions
    type: array
    items:
      type: object
      required: [type]
      properties:
        name: # name of the parameter (for documentation only)
          type: string
        description: # description (for documentation only)
          type: string
        type: # expected metatype for the parameter
          type: string
          enum:
            - dataType
            - boolean
            - integer
            - enumeration
            - string
        min: # for integers, the minimum supported value (inclusive)
          type: number
        max: # for integers, the maximum supported value (inclusive)
          type: number
        options: # for enums, the list of supported values
          $ref: "#/$defs/enum_options"
        optional: # when set to true, the parameter may be omitted at the end or skipped using null
          type: boolean
  enum_options:
    type: array
    minItems: 1
    uniqueItems: true
    items:
      type: string
  enumeration_arg:
    type: object
    additionalProperties: false
    required: [options]
    properties:
      name:
        type: string
      description:
        type: string
      options:
        $ref: "#/$defs/enum_options"
  value_arg:
    type: object
    required: [value]
    properties:
      name:
        type: string
      description:
        type: string
      value:
        $ref: "#/$defs/type"
      constant:
        type: boolean
  type_arg:
    type: object
    required: [type]
    properties:
      name:
        type: string
      description:
        type: string
      type:
        type: string
  arguments: # an array of arguments
    type: array
    items:
      oneOf:
        - $ref: "#/$defs/enumeration_arg"
        - $ref: "#/$defs/value_arg"
        - $ref: "#/$defs/type_arg"
  options: # a map of options
    type: object
    additionalProperties:
      type: object # option
      additionalProperties: false
      required: [values]
      properties:
        description:
          type: string
        values:
          type: array
          items:
            type: string
  variadicBehavior:
    type: object
    additionalProperties: false
    properties:
      min:
        type: number
      max:
        type: number
      parameterConsistency:
        type: string
        enum: [CONSISTENT, INCONSISTENT]
  deterministic:
    type: boolean
  sessionDependent:
    type: boolean
  nullabilityHandling:
    type: string
    enum: [MIRROR, DECLARED_OUTPUT, DISCRETE]
  returnValue:
    $ref: "#/$defs/type"
  implementation:
    type: object
    additionalProperties:
      type: string
  intermediate:
    $ref: "#/$defs/type"
  decomposable:
    type: string
    enum: [NONE, ONE, MANY]
  maxset:
    type: number
  ordered:
    type: boolean
  scalarFunction:
    type: object
    additionalProperties: false
    required: [name, impls]
    properties:
      name:
        type: string
      description:
        type: string
      impls:
        type: array
        minItems: 1
        items:
          type: object
          additionalProperties: false
          required: [return]
          properties:
            args:
              $ref: "#/$defs/arguments"
            options:
              $ref: "#/$defs/options"
            variadic:
              $ref: "#/$defs/variadicBehavior"
            sessionDependent:
              $ref: "#/$defs/sessionDependent"
            deterministic:
              $ref: "#/$defs/deterministic"
            nullability:
              $ref: "#/$defs/nullabilityHandling"
            return:
              $ref: "#/$defs/returnValue"
            implementation:
              $ref: "#/$defs/implementation"
  aggregateFunction:
    type: object
    additionalProperties: false
    required: [name, impls]
    properties:
      name:
        type: string
      description:
        type: string
      impls:
        type: array
        minItems: 1
        items:
          type: object
          additionalProperties: false
          required: [return]
          properties:
            args:
              $ref: "#/$defs/arguments"
            options:
              $ref: "#/$defs/options"
            variadic:
              $ref: "#/$defs/variadicBehavior"
            sessionDependent:
              $ref: "#/$defs/sessionDependent"
            deterministic:
              $ref: "#/$defs/deterministic"
            nullability:
              $ref: "#/$defs/nullabilityHandling"
            return:
              $ref: "#/$defs/returnValue"
            implementation:
              $ref: "#/$defs/implementation"
            intermediate:
              $ref: "#/$defs/intermediate"
            ordered:
              $ref: "#/$defs/ordered"
            maxset:
              $ref: "#/$defs/maxset"
            decomposable:
              $ref: "#/$defs/decomposable"

  windowFunction:
    type: object
    additionalProperties: false
    required: [name, impls]
    properties:
      name:
        type: string
      description:
        type: string
      impls:
        type: array
        minItems: 1
        items:
          type: object
          additionalProperties: false
          required: [return]
          properties:
            args:
              $ref: "#/$defs/arguments"
            options:
              $ref: "#/$defs/options"
            variadic:
              $ref: "#/$defs/variadicBehavior"
            sessionDependent:
              $ref: "#/$defs/sessionDependent"
            deterministic:
              $ref: "#/$defs/deterministic"
            nullability:
              $ref: "#/$defs/nullabilityHandling"
            return:
              $ref: "#/$defs/returnValue"
            implementation:
              $ref: "#/$defs/implementation"
            intermediate:
              $ref: "#/$defs/intermediate"
            ordered:
              $ref: "#/$defs/ordered"
            maxset:
              $ref: "#/$defs/maxset"
            decomposable:
              $ref: "#/$defs/decomposable"
            window_type:
              type: string
              enum: [STREAMING, PARTITION]