import { xLuceneTypeConfig, ClientMetadata } from '@terascope/types'; import BaseType, { ToGraphQLOptions } from './base-type.js'; import { GraphQLType, TypeESMapping, DuckDBTypeConfig } from '../interfaces.js'; export type NestedTypes = { [field: string]: BaseType; }; /** * Represents an `Object` field together with its nested children as a single * grouped unit. This is not a `FieldType` you declare directly — it is * assembled during field grouping (`getGroupType`) from an `Object` parent and * its dot-notation children (e.g. `user` + `user.id` + `user.name`), so the * parent and its descendants convert together into one nested structure. * * - **ES/OpenSearch mapping:** the parent's `object`/`nested` mapping with each * child folded into its `properties` (recursively, since a child may itself * be a group), merging any analyzers/tokenizers the children contribute. * - **GraphQL:** a generated nested type (`DTV`) whose * fields are the children, referenced from the parent type. * - **xLucene:** the merged xLucene configs of the parent and all children, * keyed by their full dot-notation paths. * - **DuckDB:** one entry holding a nested `STRUCT`, since DuckDB nests rather than * flattens. Unlike the conversions above it nests past one level; see * {@link GroupType.toDuckDB}. * * @see {@link TupleType} for the ordered-set analogue. */ export default class GroupType extends BaseType { readonly types: NestedTypes; constructor(field: string, version: number, types: NestedTypes); /** * Emit the parent's mapping with each child nested under its `properties`, * accumulating any analyzers/tokenizers contributed by the children. */ toESMapping(config: ClientMetadata): TypeESMapping; /** * Emit a generated nested GraphQL type built from the children and return * the parent field referencing it (as `[list]` when the parent is an array). */ toGraphQL(options?: ToGraphQLOptions): GraphQLType; toXlucene(): xLuceneTypeConfig; /** * Return the parent as a single `STRUCT(child TYPE, ...)` entry built from its children. * * Unlike `toXlucene`, children are not flattened into columns of their own, so the result * has exactly one key. An Object with no children stays `JSON`, since its shape is unknown. * * `getGroupedFields` splits on the first dot only, so `this.types` is flat: `a.b` and * `a.b.c` are siblings here. Used as-is that would produce `STRUCT(b JSON, "b.c" VARCHAR)`, * an invalid table definition, so the dotted paths are regrouped and nested. */ toDuckDB(): DuckDBTypeConfig; private _removeBase; } //# sourceMappingURL=group-type.d.ts.map