substrait-extensions 0.100.0

Packaged Substrait Extension Files
Documentation
%YAML 1.2
---
urn: extension:io.substrait:unsigned_integers

types:
  - name: u8
    description: >
      Unsigned 8-bit integer (0 to 255).
      Values are encoded as decimal strings in the structure representation.
    structure:
      value: string
  - name: u16
    description: >
      Unsigned 16-bit integer (0 to 65535).
      Values are encoded as decimal strings in the structure representation.
    structure:
      value: string
  - name: u32
    description: >
      Unsigned 32-bit integer (0 to 4294967295).
      Values are encoded as decimal strings in the structure representation.
    structure:
      value: string
  - name: u64
    description: >
      Unsigned 64-bit integer (0 to 18446744073709551615).
      Values are encoded as decimal strings in the structure representation.
    structure:
      value: string

scalar_functions:
  -
    name: "add"
    description: "Add two unsigned integer values."
    impls:
      - args:
          - name: x
            value: u!u8
          - name: y
            value: u!u8
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u8
      - args:
          - name: x
            value: u!u16
          - name: y
            value: u!u16
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u16
      - args:
          - name: x
            value: u!u32
          - name: y
            value: u!u32
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u32
      - args:
          - name: x
            value: u!u64
          - name: y
            value: u!u64
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u64
  -
    name: "subtract"
    description: "Subtract one unsigned integer value from another."
    impls:
      - args:
          - name: x
            value: u!u8
          - name: y
            value: u!u8
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u8
      - args:
          - name: x
            value: u!u16
          - name: y
            value: u!u16
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u16
      - args:
          - name: x
            value: u!u32
          - name: y
            value: u!u32
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u32
      - args:
          - name: x
            value: u!u64
          - name: y
            value: u!u64
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u64
  -
    name: "multiply"
    description: "Multiply two unsigned integer values."
    impls:
      - args:
          - name: x
            value: u!u8
          - name: y
            value: u!u8
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u8
      - args:
          - name: x
            value: u!u16
          - name: y
            value: u!u16
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u16
      - args:
          - name: x
            value: u!u32
          - name: y
            value: u!u32
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u32
      - args:
          - name: x
            value: u!u64
          - name: y
            value: u!u64
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        return: u!u64
  -
    name: "divide"
    description: >
      Divide x by y. Partial values are truncated (i.e. rounded towards 0).
      The `on_division_by_zero` option governs behavior in cases where y is 0.
      If either x or y are out of range, behavior will be governed by `on_domain_error`.
    impls:
      - args:
          - name: x
            value: u!u8
          - name: y
            value: u!u8
        options:
          on_domain_error:
            values: [ "NULL", ERROR ]
          on_division_by_zero:
            values: [ "NULL", ERROR ]
        return: u!u8
      - args:
          - name: x
            value: u!u16
          - name: y
            value: u!u16
        options:
          on_domain_error:
            values: [ "NULL", ERROR ]
          on_division_by_zero:
            values: [ "NULL", ERROR ]
        return: u!u16
      - args:
          - name: x
            value: u!u32
          - name: y
            value: u!u32
        options:
          on_domain_error:
            values: [ "NULL", ERROR ]
          on_division_by_zero:
            values: [ "NULL", ERROR ]
        return: u!u32
      - args:
          - name: x
            value: u!u64
          - name: y
            value: u!u64
        options:
          on_domain_error:
            values: [ "NULL", ERROR ]
          on_division_by_zero:
            values: [ "NULL", ERROR ]
        return: u!u64

aggregate_functions:
  - name: "sum"
    description: Sum a set of unsigned integer values. The sum of zero elements yields null.
    impls:
      - args:
          - name: x
            value: u!u8
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u64?
        return: u!u64?
      - args:
          - name: x
            value: u!u16
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u64?
        return: u!u64?
      - args:
          - name: x
            value: u!u32
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u64?
        return: u!u64?
      - args:
          - name: x
            value: u!u64
        options:
          overflow:
            values: [ SILENT, SATURATE, ERROR ]
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u64?
        return: u!u64?
  - name: "min"
    description: Min of a set of unsigned integer values.
    impls:
      - args:
          - name: x
            value: u!u8
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u8?
        return: u!u8?
      - args:
          - name: x
            value: u!u16
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u16?
        return: u!u16?
      - args:
          - name: x
            value: u!u32
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u32?
        return: u!u32?
      - args:
          - name: x
            value: u!u64
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u64?
        return: u!u64?
  - name: "max"
    description: Max of a set of unsigned integer values.
    impls:
      - args:
          - name: x
            value: u!u8
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u8?
        return: u!u8?
      - args:
          - name: x
            value: u!u16
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u16?
        return: u!u16?
      - args:
          - name: x
            value: u!u32
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u32?
        return: u!u32?
      - args:
          - name: x
            value: u!u64
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: u!u64?
        return: u!u64?