| 1 | import type * as glue from "@distilled.cloud/aws/glue"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Table } from "./Table.ts"; |
| 5 | |
| 6 | export interface BatchCreatePartitionRequest extends Omit< |
| 7 | glue.BatchCreatePartitionRequest, |
| 8 | "DatabaseName" | "TableName" | "CatalogId" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `glue:BatchCreatePartition`. |
| 13 | * |
| 14 | * Registers up to 100 partitions on the bound {@link Table} in one call — |
| 15 | * the bulk variant of `CreatePartition` for backfills. Per-partition |
| 16 | * failures come back in the response's `Errors` list. The database/table |
| 17 | * names and catalog id are injected from the binding. Provide the |
| 18 | * implementation with `Effect.provide(AWS.Glue.BatchCreatePartitionHttp)`. |
| 19 | * ### Managing Partitions |
| 20 | * **Example:** Backfill Partitions |
| 21 | * ```typescript |
| 22 | * // init |
| 23 | * const batchCreatePartition = yield* AWS.Glue.BatchCreatePartition(table); |
| 24 | * |
| 25 | * // runtime |
| 26 | * const { Errors } = yield* batchCreatePartition({ |
| 27 | * PartitionInputList: days.map((dt) => ({ Values: [dt] })), |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface BatchCreatePartition extends Binding.Service< |
| 34 | BatchCreatePartition, |
| 35 | "AWS.Glue.BatchCreatePartition", |
| 36 | ( |
| 37 | table: Table, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: BatchCreatePartitionRequest, |
| 41 | ) => Effect.Effect< |
| 42 | glue.BatchCreatePartitionResponse, |
| 43 | glue.BatchCreatePartitionError |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | |
| 48 | export const BatchCreatePartition = Binding.Service<BatchCreatePartition>( |
| 49 | "AWS.Glue.BatchCreatePartition", |
| 50 | ); |