IR:
    | { k: "func"; name: string; origin?: Origin; params: readonly IR[] }
    | { k: "property"; name: string; origin?: Origin; receiver: IR }
    | { k: "var"; name: string }
    | { body: readonly IR[]; k: "lambda"; params: readonly string[] }
    | { k: "literal"; origin?: Origin; value: LiteralValue }
    | { k: "collection"; values: readonly IR[] }
    | { fn1?: IR; fn2?: IR; k: "colSpec"; name: string }
    | { k: "colSpecArray"; specs: readonly IR[] }
    | {
        k: "storeAccessor";
        origin?: Origin;
        path: readonly [string, string, string];
    }
    | {
        k: "dataProductAccessor";
        origin?: Origin;
        path: readonly [string, string];
    }
    | {
        k: "ingestAccessor";
        origin?: Origin;
        path: readonly [string, string];
        urn?: string;
    }
    | { k: "elementPtr"; path: string }
    | { k: "genericType"; params?: readonly number[]; path: string }
    | { columns: readonly RelationTypeColumn[]; k: "relationType" }
    | { enumPath: string; k: "enumValue"; origin?: Origin; value: string }
    | { k: "let"; name: string; origin?: Origin; value: IR }
    | { json: unknown; k: "raw" }
    | { json: JsonObject; k: "lambdaJson"; origin?: Origin }

The Cube IR: a host-free model of the Pure expression Cube runs, one-to-one with the engine's protocol JSON (which the builder's serializer produces). Every arrow call and operator is a func whose first parameter is its receiver or left operand, as the engine's parser builds it.

Type declaration

  • { k: "func"; name: string; origin?: Origin; params: readonly IR[] }
  • { k: "property"; name: string; origin?: Origin; receiver: IR }
  • { k: "var"; name: string }
  • { body: readonly IR[]; k: "lambda"; params: readonly string[] }
  • { k: "literal"; origin?: Origin; value: LiteralValue }
  • { k: "collection"; values: readonly IR[] }
  • { fn1?: IR; fn2?: IR; k: "colSpec"; name: string }
  • { k: "colSpecArray"; specs: readonly IR[] }
  • { k: "storeAccessor"; origin?: Origin; path: readonly [string, string, string] }
    • Readonlyk: "storeAccessor"
    • Optional Readonlyorigin?: Origin
    • Readonlypath: readonly [string, string, string]

      The Database element's path, then the schema and table names as stored (quotes included)

  • { k: "dataProductAccessor"; origin?: Origin; path: readonly [string, string] }

    A data product's access point (#P{dp.ap}#, PLAN §6.8): never one with parameters, so it has none

    • Readonlyk: "dataProductAccessor"
    • Optional Readonlyorigin?: Origin
    • Readonlypath: readonly [string, string]

      The data product's element path, then the access point's id; its group is not part of it

  • {
        k: "ingestAccessor";
        origin?: Origin;
        path: readonly [string, string];
        urn?: string;
    }

    A data set of a deployed ingest definition (#I{definition.dataSet}#): read as data, never its metadata

    • Readonlyk: "ingestAccessor"
    • Optional Readonlyorigin?: Origin
    • Readonlypath: readonly [string, string]

      The ingest definition's element path, then the data set's name

    • Optional Readonlyurn?: string

      The deployed definition's URN, which the host reads it by: not part of the query

  • { k: "elementPtr"; path: string }

    A packageable element, such as the runtime; never a type

  • { k: "genericType"; params?: readonly number[]; path: string }

    A type argument, e.g. of cast: @String, @meta::pure::precisePrimitives::Varchar(15)

  • { columns: readonly RelationTypeColumn[]; k: "relationType" }

    A relation type argument, of cast: @Relation<(COUNTRY:Varchar(15), '2000':Integer)>, each column of the type a genericType (PLAN §11.12)

  • { enumPath: string; k: "enumValue"; origin?: Origin; value: string }

    An enumeration value, e.g. JoinKind.INNER

  • { k: "let"; name: string; origin?: Origin; value: IR }

    let <name> = <value>, a statement of a lambda with several, which the last one reads as $<name>: how a window is isolated from what follows it (window isolation, PLAN §8.6)

  • { json: unknown; k: "raw" }

    Protocol JSON passed through as is

  • { json: JsonObject; k: "lambdaJson"; origin?: Origin }

    A lambda Cube holds as the engine's JSON, an Extend column's expression (PLAN §11.7): without source information, its number literals as their digit strings; written with its numbers digit for digit and the origin on each value specification