Skip to content

Commit f4ee5d6

Browse files
author
awstools
committed
feat(client-glue): This release enables customers to create new Apache Iceberg tables and associated metadata in Amazon S3 by using native AWS Glue CreateTable operation.
1 parent 29a8b11 commit f4ee5d6

File tree

7 files changed

+178
-68
lines changed

7 files changed

+178
-68
lines changed

clients/client-glue/src/commands/CreateTableCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ export interface CreateTableCommandOutput extends CreateTableResponse, __Metadat
139139
* },
140140
* ],
141141
* TransactionId: "STRING_VALUE",
142+
* OpenTableFormatInput: { // OpenTableFormatInput
143+
* IcebergInput: { // IcebergInput
144+
* MetadataOperation: "CREATE", // required
145+
* Version: "STRING_VALUE",
146+
* },
147+
* },
142148
* };
143149
* const command = new CreateTableCommand(input);
144150
* const response = await client.send(command);

clients/client-glue/src/commands/GetUnfilteredTableMetadataCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import {
1414
} from "@smithy/types";
1515

1616
import { GlueClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GlueClient";
17-
import { GetUnfilteredTableMetadataRequest, GetUnfilteredTableMetadataResponse } from "../models/models_1";
17+
import { GetUnfilteredTableMetadataRequest } from "../models/models_1";
18+
import { GetUnfilteredTableMetadataResponse } from "../models/models_2";
1819
import { de_GetUnfilteredTableMetadataCommand, se_GetUnfilteredTableMetadataCommand } from "../protocols/Aws_json1_1";
1920

2021
/**

clients/client-glue/src/commands/GetUserDefinedFunctionCommand.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import {
1414
} from "@smithy/types";
1515

1616
import { GlueClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GlueClient";
17-
import { GetUserDefinedFunctionRequest } from "../models/models_1";
18-
import { GetUserDefinedFunctionResponse } from "../models/models_2";
17+
import { GetUserDefinedFunctionRequest, GetUserDefinedFunctionResponse } from "../models/models_2";
1918
import { de_GetUserDefinedFunctionCommand, se_GetUserDefinedFunctionCommand } from "../protocols/Aws_json1_1";
2019

2120
/**

clients/client-glue/src/models/models_1.ts

Lines changed: 45 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,46 @@ export interface CreateSessionResponse {
10171017
Session?: Session;
10181018
}
10191019

1020+
/**
1021+
* @public
1022+
* @enum
1023+
*/
1024+
export const MetadataOperation = {
1025+
CREATE: "CREATE",
1026+
} as const;
1027+
1028+
/**
1029+
* @public
1030+
*/
1031+
export type MetadataOperation = (typeof MetadataOperation)[keyof typeof MetadataOperation];
1032+
1033+
/**
1034+
* @public
1035+
* <p>A structure that defines an Apache Iceberg metadata table to create in the catalog.</p>
1036+
*/
1037+
export interface IcebergInput {
1038+
/**
1039+
* <p>A required metadata operation. Can only be set to <code>CREATE</code>.</p>
1040+
*/
1041+
MetadataOperation: MetadataOperation | string | undefined;
1042+
1043+
/**
1044+
* <p>The table version for the Iceberg table. Defaults to 2.</p>
1045+
*/
1046+
Version?: string;
1047+
}
1048+
1049+
/**
1050+
* @public
1051+
* <p>A structure representing an open format table.</p>
1052+
*/
1053+
export interface OpenTableFormatInput {
1054+
/**
1055+
* <p>Specifies an <code>IcebergInput</code> structure that defines an Apache Iceberg metadata table.</p>
1056+
*/
1057+
IcebergInput?: IcebergInput;
1058+
}
1059+
10201060
/**
10211061
* @public
10221062
* <p>A structure that describes a target table for resource linking.</p>
@@ -1170,6 +1210,11 @@ export interface CreateTableRequest {
11701210
* <p>The ID of the transaction.</p>
11711211
*/
11721212
TransactionId?: string;
1213+
1214+
/**
1215+
* <p>Specifies an <code>OpenTableFormatInput</code> structure when creating an open format table.</p>
1216+
*/
1217+
OpenTableFormatInput?: OpenTableFormatInput;
11731218
}
11741219

11751220
/**
@@ -7169,66 +7214,3 @@ export interface GetUnfilteredTableMetadataRequest {
71697214
*/
71707215
SupportedPermissionTypes: (PermissionType | string)[] | undefined;
71717216
}
7172-
7173-
/**
7174-
* @public
7175-
* <p>A filter that uses both column-level and row-level filtering.</p>
7176-
*/
7177-
export interface ColumnRowFilter {
7178-
/**
7179-
* <p>A string containing the name of the column.</p>
7180-
*/
7181-
ColumnName?: string;
7182-
7183-
/**
7184-
* <p>A string containing the row-level filter expression.</p>
7185-
*/
7186-
RowFilterExpression?: string;
7187-
}
7188-
7189-
/**
7190-
* @public
7191-
*/
7192-
export interface GetUnfilteredTableMetadataResponse {
7193-
/**
7194-
* <p>A Table object containing the table metadata.</p>
7195-
*/
7196-
Table?: Table;
7197-
7198-
/**
7199-
* <p>A list of column names that the user has been granted access to.</p>
7200-
*/
7201-
AuthorizedColumns?: string[];
7202-
7203-
/**
7204-
* <p>A Boolean value that indicates whether the partition location is registered
7205-
* with Lake Formation.</p>
7206-
*/
7207-
IsRegisteredWithLakeFormation?: boolean;
7208-
7209-
/**
7210-
* <p>A list of column row filters.</p>
7211-
*/
7212-
CellFilters?: ColumnRowFilter[];
7213-
}
7214-
7215-
/**
7216-
* @public
7217-
*/
7218-
export interface GetUserDefinedFunctionRequest {
7219-
/**
7220-
* <p>The ID of the Data Catalog where the function to be retrieved is located. If none is
7221-
* provided, the Amazon Web Services account ID is used by default.</p>
7222-
*/
7223-
CatalogId?: string;
7224-
7225-
/**
7226-
* <p>The name of the catalog database where the function is located.</p>
7227-
*/
7228-
DatabaseName: string | undefined;
7229-
7230-
/**
7231-
* <p>The name of the function.</p>
7232-
*/
7233-
FunctionName: string | undefined;
7234-
}

clients/client-glue/src/models/models_2.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,69 @@ import {
123123
UserDefinedFunctionInput,
124124
} from "./models_1";
125125

126+
/**
127+
* @public
128+
* <p>A filter that uses both column-level and row-level filtering.</p>
129+
*/
130+
export interface ColumnRowFilter {
131+
/**
132+
* <p>A string containing the name of the column.</p>
133+
*/
134+
ColumnName?: string;
135+
136+
/**
137+
* <p>A string containing the row-level filter expression.</p>
138+
*/
139+
RowFilterExpression?: string;
140+
}
141+
142+
/**
143+
* @public
144+
*/
145+
export interface GetUnfilteredTableMetadataResponse {
146+
/**
147+
* <p>A Table object containing the table metadata.</p>
148+
*/
149+
Table?: Table;
150+
151+
/**
152+
* <p>A list of column names that the user has been granted access to.</p>
153+
*/
154+
AuthorizedColumns?: string[];
155+
156+
/**
157+
* <p>A Boolean value that indicates whether the partition location is registered
158+
* with Lake Formation.</p>
159+
*/
160+
IsRegisteredWithLakeFormation?: boolean;
161+
162+
/**
163+
* <p>A list of column row filters.</p>
164+
*/
165+
CellFilters?: ColumnRowFilter[];
166+
}
167+
168+
/**
169+
* @public
170+
*/
171+
export interface GetUserDefinedFunctionRequest {
172+
/**
173+
* <p>The ID of the Data Catalog where the function to be retrieved is located. If none is
174+
* provided, the Amazon Web Services account ID is used by default.</p>
175+
*/
176+
CatalogId?: string;
177+
178+
/**
179+
* <p>The name of the catalog database where the function is located.</p>
180+
*/
181+
DatabaseName: string | undefined;
182+
183+
/**
184+
* <p>The name of the function.</p>
185+
*/
186+
FunctionName: string | undefined;
187+
}
188+
126189
/**
127190
* @public
128191
* <p>Represents the equivalent of a Hive user-defined function

clients/client-glue/src/protocols/Aws_json1_1.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,16 +831,16 @@ import {
831831
GetUnfilteredPartitionsMetadataRequest,
832832
GetUnfilteredPartitionsMetadataResponse,
833833
GetUnfilteredTableMetadataRequest,
834-
GetUnfilteredTableMetadataResponse,
835-
GetUserDefinedFunctionRequest,
836834
GluePolicy,
837835
GrokClassifier,
836+
IcebergInput,
838837
JobBookmarksEncryption,
839838
JsonClassifier,
840839
Location,
841840
LongColumnStatisticsData,
842841
MappingEntry,
843842
MLTransform,
843+
OpenTableFormatInput,
844844
PartitionIndex,
845845
PermissionType,
846846
PermissionTypeMismatchException,
@@ -892,6 +892,8 @@ import {
892892
DevEndpointCustomLibraries,
893893
GetJobResponse,
894894
GetJobsResponse,
895+
GetUnfilteredTableMetadataResponse,
896+
GetUserDefinedFunctionRequest,
895897
GetUserDefinedFunctionResponse,
896898
GetUserDefinedFunctionsRequest,
897899
GetUserDefinedFunctionsResponse,
@@ -16117,6 +16119,7 @@ const se_CreateTableRequest = (input: CreateTableRequest, context: __SerdeContex
1611716119
return take(input, {
1611816120
CatalogId: [],
1611916121
DatabaseName: [],
16122+
OpenTableFormatInput: _json,
1612016123
PartitionIndexes: _json,
1612116124
TableInput: (_) => se_TableInput(_, context),
1612216125
TransactionId: [],
@@ -16656,6 +16659,8 @@ const se_GetTablesRequest = (input: GetTablesRequest, context: __SerdeContext):
1665616659

1665716660
// se_GovernedCatalogTarget omitted.
1665816661

16662+
// se_IcebergInput omitted.
16663+
1665916664
// se_IcebergTarget omitted.
1666016665

1666116666
// se_IcebergTargetList omitted.
@@ -16947,6 +16952,8 @@ const se_Mappings = (input: Mapping[], context: __SerdeContext): any => {
1694716952

1694816953
// se_OneInput omitted.
1694916954

16955+
// se_OpenTableFormatInput omitted.
16956+
1695016957
// se_Option omitted.
1695116958

1695216959
// se_OptionList omitted.

codegen/sdk-codegen/aws-models/glue.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9120,6 +9120,12 @@
91209120
"traits": {
91219121
"smithy.api#documentation": "<p>The ID of the transaction.</p>"
91229122
}
9123+
},
9124+
"OpenTableFormatInput": {
9125+
"target": "com.amazonaws.glue#OpenTableFormatInput",
9126+
"traits": {
9127+
"smithy.api#documentation": "<p>Specifies an <code>OpenTableFormatInput</code> structure when creating an open format table.</p>"
9128+
}
91239129
}
91249130
},
91259131
"traits": {
@@ -19764,6 +19770,27 @@
1976419770
}
1976519771
}
1976619772
},
19773+
"com.amazonaws.glue#IcebergInput": {
19774+
"type": "structure",
19775+
"members": {
19776+
"MetadataOperation": {
19777+
"target": "com.amazonaws.glue#MetadataOperation",
19778+
"traits": {
19779+
"smithy.api#documentation": "<p>A required metadata operation. Can only be set to <code>CREATE</code>.</p>",
19780+
"smithy.api#required": {}
19781+
}
19782+
},
19783+
"Version": {
19784+
"target": "com.amazonaws.glue#VersionString",
19785+
"traits": {
19786+
"smithy.api#documentation": "<p>The table version for the Iceberg table. Defaults to 2.</p>"
19787+
}
19788+
}
19789+
},
19790+
"traits": {
19791+
"smithy.api#documentation": "<p>A structure that defines an Apache Iceberg metadata table to create in the catalog.</p>"
19792+
}
19793+
},
1976719794
"com.amazonaws.glue#IcebergTarget": {
1976819795
"type": "structure",
1976919796
"members": {
@@ -23862,6 +23889,17 @@
2386223889
"target": "com.amazonaws.glue#MetadataKeyValuePair"
2386323890
}
2386423891
},
23892+
"com.amazonaws.glue#MetadataOperation": {
23893+
"type": "enum",
23894+
"members": {
23895+
"CREATE": {
23896+
"target": "smithy.api#Unit",
23897+
"traits": {
23898+
"smithy.api#enumValue": "CREATE"
23899+
}
23900+
}
23901+
}
23902+
},
2386523903
"com.amazonaws.glue#MetadataValueString": {
2386623904
"type": "string",
2386723905
"traits": {
@@ -24301,6 +24339,20 @@
2430124339
}
2430224340
}
2430324341
},
24342+
"com.amazonaws.glue#OpenTableFormatInput": {
24343+
"type": "structure",
24344+
"members": {
24345+
"IcebergInput": {
24346+
"target": "com.amazonaws.glue#IcebergInput",
24347+
"traits": {
24348+
"smithy.api#documentation": "<p>Specifies an <code>IcebergInput</code> structure that defines an Apache Iceberg metadata table.</p>"
24349+
}
24350+
}
24351+
},
24352+
"traits": {
24353+
"smithy.api#documentation": "<p>A structure representing an open format table.</p>"
24354+
}
24355+
},
2430424356
"com.amazonaws.glue#OperationTimeoutException": {
2430524357
"type": "structure",
2430624358
"members": {

0 commit comments

Comments
 (0)