LakeQL
Introduction
  • Overview
  • Why LakeQL
  • Key Concepts
Getting Started
  • Prerequisites
  • Quickstart
  • Environment
  • First Run
Architecture
  • System Overview
  • Data Flow
  • Request Lifecycle
Configuration
  • Config File
  • Runtime Lifecycle
  • Environment Variables
create-app
  • Usage
  • Template Structure
  • Post-Creation
Guides
  • Custom Resolvers
  • Extending the Schema
  • Mutations
  • Set Up a Trino Mutation
  • Deploying
Endpoints
  • Definition Format
  • Field Types
  • Nested Fields
  • Mutations
  • Glossary
Contributing
  • Local Development
  • Contribution Guide
  • Architecture
GitHub
LakeQL
  1. LakeQL
  2. Endpoints
  3. Nested Fields

On this page

  1. Object
  2. Array

Nested Fields

Object and Array field types, including recursive nesting.

Beyond the six primitives in Field Types, a field can be an Object or an Array.

Object #

An Object field nests its own fields array. That array has the same shape as the top-level fields array, including further Object or Array fields. At least one field is required.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21{
  "version": "1.0",
  "catalog": "hive",
  "schema": "sales",
  "tableName": "customers",
  "fields": [
    { "name": "id", "type": "Integer", "options": { "required": true } },
    { "name": "name", "type": "String" },
    {
      "name": "address",
      "type": "Object",
      "fields": [
        { "name": "street", "type": "String" },
        { "name": "city", "type": "String" },
        { "name": "postalCode", "type": "String" },
        { "name": "country", "type": "String" }
      ]
    }
  ]
}

Array #

An Array field has an items definition instead of fields. items is either a bare primitive type:

1
2
3
4
5
6
{
  "name": "tags",
  "type": "Array",
  "items": { "type": "String" }
}

or an Object with its own fields array:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26{
  "version": "1.0",
  "catalog": "hive",
  "schema": "sales",
  "tableName": "orders",
  "fields": [
    { "name": "id", "type": "Integer", "options": { "required": true } },
    {
      "name": "lineItems",
      "type": "Array",
      "items": {
        "type": "Object",
        "fields": [
          { "name": "sku", "type": "String", "options": { "required": true } },
          {
            "name": "quantity",
            "type": "Integer",
            "options": { "required": true }
          },
          { "name": "unitPrice", "type": "Float" }
        ]
      }
    }
  ]
}

Object and Array fields nest recursively. An Object field inside an Array's items can itself contain further Object or Array fields, to whatever depth your table structure needs.

Previous page

Field Types

Next page

Mutations

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26