{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rippit-com/json-schema/rippit-com-export-query-schema.json",
  "title": "ExportQuery",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rippit-com-bulk-openapi.json#/components/schemas/ExportQuery",
  "properties": {
    "select": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/WorkspaceField"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Select",
      "description": "Columns, each optionally with `agg` (count, count_distinct, sum, avg, min, max) and `alias`. Leave out for every column."
    },
    "where": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Where",
      "description": "RipQL subset: `col op literal` with AND / OR, e.g. `n > 1 AND tier IN ('a', 'b')`."
    },
    "group_by": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Group By",
      "default": []
    },
    "order_by": {
      "items": {
        "prefixItems": [
          {
            "type": "string"
          },
          {
            "type": "boolean"
          }
        ],
        "type": "array",
        "maxItems": 2,
        "minItems": 2
      },
      "type": "array",
      "title": "Order By",
      "description": "`[column or alias, ascending]` pairs.",
      "default": []
    },
    "limit": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Limit",
      "description": "Leave out for every row."
    },
    "format": {
      "type": "string",
      "enum": [
        "parquet",
        "csv"
      ],
      "title": "Format",
      "description": "csv is gzipped.",
      "default": "parquet"
    }
  },
  "type": "object",
  "$defs": {
    "WorkspaceField": {
      "properties": {
        "field": {
          "type": "string",
          "title": "Field"
        },
        "agg": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "sum",
                "avg",
                "max",
                "min",
                "count",
                "count_distinct",
                "stddev_pop",
                "stddev_samp"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Agg"
        },
        "date_trunc": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "minute",
                "hour",
                "day",
                "week",
                "month",
                "year"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Date Trunc"
        },
        "alias": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Alias"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "field"
      ],
      "title": "WorkspaceField"
    }
  }
}