Skip to content

Commit 349fcc9

Browse files
author
awstools
committed
feat(client-glue): This release adds support for creating and updating Glue Data Catalog Views.
1 parent ec83f87 commit 349fcc9

14 files changed

+458
-161
lines changed

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

+16
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,22 @@ export interface CreateTableCommandOutput extends CreateTableResponse, __Metadat
121121
* Name: "STRING_VALUE",
122122
* Region: "STRING_VALUE",
123123
* },
124+
* ViewDefinition: { // ViewDefinitionInput
125+
* IsProtected: true || false,
126+
* Definer: "STRING_VALUE",
127+
* Representations: [ // ViewRepresentationInputList
128+
* { // ViewRepresentationInput
129+
* Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
130+
* DialectVersion: "STRING_VALUE",
131+
* ViewOriginalText: "STRING_VALUE",
132+
* ValidationConnection: "STRING_VALUE",
133+
* ViewExpandedText: "STRING_VALUE",
134+
* },
135+
* ],
136+
* SubObjects: [ // ViewSubObjectsList
137+
* "STRING_VALUE",
138+
* ],
139+
* },
124140
* },
125141
* PartitionIndexes: [ // PartitionIndexList
126142
* { // PartitionIndex

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { GlueClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GlueClient";
9-
import { GetSchemaByDefinitionInput, GetSchemaByDefinitionResponse } from "../models/models_1";
9+
import { GetSchemaByDefinitionInput, GetSchemaByDefinitionResponse } from "../models/models_2";
1010
import { de_GetSchemaByDefinitionCommand, se_GetSchemaByDefinitionCommand } from "../protocols/Aws_json1_1";
1111

1212
/**

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { GlueClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GlueClient";
9-
import { GetSchemaInput, GetSchemaResponse } from "../models/models_1";
9+
import { GetSchemaInput } from "../models/models_1";
10+
import { GetSchemaResponse } from "../models/models_2";
1011
import { de_GetSchemaCommand, se_GetSchemaCommand } from "../protocols/Aws_json1_1";
1112

1213
/**

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

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export interface GetTableCommandOutput extends GetTableResponse, __MetadataBeare
153153
* // DialectVersion: "STRING_VALUE",
154154
* // ViewOriginalText: "STRING_VALUE",
155155
* // ViewExpandedText: "STRING_VALUE",
156+
* // ValidationConnection: "STRING_VALUE",
156157
* // IsStale: true || false,
157158
* // },
158159
* // ],

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

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export interface GetTableVersionCommandOutput extends GetTableVersionResponse, _
152152
* // DialectVersion: "STRING_VALUE",
153153
* // ViewOriginalText: "STRING_VALUE",
154154
* // ViewExpandedText: "STRING_VALUE",
155+
* // ValidationConnection: "STRING_VALUE",
155156
* // IsStale: true || false,
156157
* // },
157158
* // ],

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

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export interface GetTableVersionsCommandOutput extends GetTableVersionsResponse,
155155
* // DialectVersion: "STRING_VALUE",
156156
* // ViewOriginalText: "STRING_VALUE",
157157
* // ViewExpandedText: "STRING_VALUE",
158+
* // ValidationConnection: "STRING_VALUE",
158159
* // IsStale: true || false,
159160
* // },
160161
* // ],

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

+1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export interface GetTablesCommandOutput extends GetTablesResponse, __MetadataBea
156156
* // DialectVersion: "STRING_VALUE",
157157
* // ViewOriginalText: "STRING_VALUE",
158158
* // ViewExpandedText: "STRING_VALUE",
159+
* // ValidationConnection: "STRING_VALUE",
159160
* // IsStale: true || false,
160161
* // },
161162
* // ],

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

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export interface GetUnfilteredTableMetadataCommandOutput extends GetUnfilteredTa
180180
* // DialectVersion: "STRING_VALUE",
181181
* // ViewOriginalText: "STRING_VALUE",
182182
* // ViewExpandedText: "STRING_VALUE",
183+
* // ValidationConnection: "STRING_VALUE",
183184
* // IsStale: true || false,
184185
* // },
185186
* // ],

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

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ export interface SearchTablesCommandOutput extends SearchTablesResponse, __Metad
168168
* // DialectVersion: "STRING_VALUE",
169169
* // ViewOriginalText: "STRING_VALUE",
170170
* // ViewExpandedText: "STRING_VALUE",
171+
* // ValidationConnection: "STRING_VALUE",
171172
* // IsStale: true || false,
172173
* // },
173174
* // ],

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

+18
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,28 @@ export interface UpdateTableCommandOutput extends UpdateTableResponse, __Metadat
121121
* Name: "STRING_VALUE",
122122
* Region: "STRING_VALUE",
123123
* },
124+
* ViewDefinition: { // ViewDefinitionInput
125+
* IsProtected: true || false,
126+
* Definer: "STRING_VALUE",
127+
* Representations: [ // ViewRepresentationInputList
128+
* { // ViewRepresentationInput
129+
* Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
130+
* DialectVersion: "STRING_VALUE",
131+
* ViewOriginalText: "STRING_VALUE",
132+
* ValidationConnection: "STRING_VALUE",
133+
* ViewExpandedText: "STRING_VALUE",
134+
* },
135+
* ],
136+
* SubObjects: [ // ViewSubObjectsList
137+
* "STRING_VALUE",
138+
* ],
139+
* },
124140
* },
125141
* SkipArchive: true || false,
126142
* TransactionId: "STRING_VALUE",
127143
* VersionId: "STRING_VALUE",
144+
* ViewUpdateAction: "ADD" || "REPLACE" || "ADD_OR_REPLACE" || "DROP",
145+
* Force: true || false,
128146
* };
129147
* const command = new UpdateTableCommand(input);
130148
* const response = await client.send(command);

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

+87-143
Original file line numberDiff line numberDiff line change
@@ -2455,6 +2455,87 @@ export interface TableIdentifier {
24552455
Region?: string;
24562456
}
24572457

2458+
/**
2459+
* @public
2460+
* @enum
2461+
*/
2462+
export const ViewDialect = {
2463+
ATHENA: "ATHENA",
2464+
REDSHIFT: "REDSHIFT",
2465+
SPARK: "SPARK",
2466+
} as const;
2467+
2468+
/**
2469+
* @public
2470+
*/
2471+
export type ViewDialect = (typeof ViewDialect)[keyof typeof ViewDialect];
2472+
2473+
/**
2474+
* <p>A structure containing details of a representation to update or create a Lake Formation view.</p>
2475+
* @public
2476+
*/
2477+
export interface ViewRepresentationInput {
2478+
/**
2479+
* <p>A parameter that specifies the engine type of a specific representation.</p>
2480+
* @public
2481+
*/
2482+
Dialect?: ViewDialect;
2483+
2484+
/**
2485+
* <p>A parameter that specifies the version of the engine of a specific representation.</p>
2486+
* @public
2487+
*/
2488+
DialectVersion?: string;
2489+
2490+
/**
2491+
* <p>A string that represents the original SQL query that describes the view.</p>
2492+
* @public
2493+
*/
2494+
ViewOriginalText?: string;
2495+
2496+
/**
2497+
* <p>The name of the connection to be used to validate the specific representation of the view.</p>
2498+
* @public
2499+
*/
2500+
ValidationConnection?: string;
2501+
2502+
/**
2503+
* <p>A string that represents the SQL query that describes the view with expanded resource ARNs</p>
2504+
* @public
2505+
*/
2506+
ViewExpandedText?: string;
2507+
}
2508+
2509+
/**
2510+
* <p>A structure containing details for creating or updating an Glue view.</p>
2511+
* @public
2512+
*/
2513+
export interface ViewDefinitionInput {
2514+
/**
2515+
* <p>You can set this flag as true to instruct the engine not to push user-provided operations into the logical plan of the view during query planning. However, setting this flag does not guarantee that the engine will comply. Refer to the engine's documentation to understand the guarantees provided, if any.</p>
2516+
* @public
2517+
*/
2518+
IsProtected?: boolean;
2519+
2520+
/**
2521+
* <p>The definer of a view in SQL.</p>
2522+
* @public
2523+
*/
2524+
Definer?: string;
2525+
2526+
/**
2527+
* <p>A list of structures that contains the dialect of the view, and the query that defines the view.</p>
2528+
* @public
2529+
*/
2530+
Representations?: ViewRepresentationInput[];
2531+
2532+
/**
2533+
* <p>A list of base table ARNs that make up the view.</p>
2534+
* @public
2535+
*/
2536+
SubObjects?: string[];
2537+
}
2538+
24582539
/**
24592540
* <p>A structure used to define a table.</p>
24602541
* @public
@@ -2562,6 +2643,12 @@ export interface TableInput {
25622643
* @public
25632644
*/
25642645
TargetTable?: TableIdentifier;
2646+
2647+
/**
2648+
* <p>A structure that contains all the information that defines the view, including the dialect or dialects for the view, and the query.</p>
2649+
* @public
2650+
*/
2651+
ViewDefinition?: ViewDefinitionInput;
25652652
}
25662653

25672654
/**
@@ -8262,146 +8349,3 @@ export interface GetSchemaInput {
82628349
*/
82638350
SchemaId: SchemaId | undefined;
82648351
}
8265-
8266-
/**
8267-
* @public
8268-
*/
8269-
export interface GetSchemaResponse {
8270-
/**
8271-
* <p>The name of the registry.</p>
8272-
* @public
8273-
*/
8274-
RegistryName?: string;
8275-
8276-
/**
8277-
* <p>The Amazon Resource Name (ARN) of the registry.</p>
8278-
* @public
8279-
*/
8280-
RegistryArn?: string;
8281-
8282-
/**
8283-
* <p>The name of the schema.</p>
8284-
* @public
8285-
*/
8286-
SchemaName?: string;
8287-
8288-
/**
8289-
* <p>The Amazon Resource Name (ARN) of the schema.</p>
8290-
* @public
8291-
*/
8292-
SchemaArn?: string;
8293-
8294-
/**
8295-
* <p>A description of schema if specified when created</p>
8296-
* @public
8297-
*/
8298-
Description?: string;
8299-
8300-
/**
8301-
* <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
8302-
* @public
8303-
*/
8304-
DataFormat?: DataFormat;
8305-
8306-
/**
8307-
* <p>The compatibility mode of the schema.</p>
8308-
* @public
8309-
*/
8310-
Compatibility?: Compatibility;
8311-
8312-
/**
8313-
* <p>The version number of the checkpoint (the last time the compatibility mode was changed).</p>
8314-
* @public
8315-
*/
8316-
SchemaCheckpoint?: number;
8317-
8318-
/**
8319-
* <p>The latest version of the schema associated with the returned schema definition.</p>
8320-
* @public
8321-
*/
8322-
LatestSchemaVersion?: number;
8323-
8324-
/**
8325-
* <p>The next version of the schema associated with the returned schema definition.</p>
8326-
* @public
8327-
*/
8328-
NextSchemaVersion?: number;
8329-
8330-
/**
8331-
* <p>The status of the schema.</p>
8332-
* @public
8333-
*/
8334-
SchemaStatus?: SchemaStatus;
8335-
8336-
/**
8337-
* <p>The date and time the schema was created.</p>
8338-
* @public
8339-
*/
8340-
CreatedTime?: string;
8341-
8342-
/**
8343-
* <p>The date and time the schema was updated.</p>
8344-
* @public
8345-
*/
8346-
UpdatedTime?: string;
8347-
}
8348-
8349-
/**
8350-
* @public
8351-
*/
8352-
export interface GetSchemaByDefinitionInput {
8353-
/**
8354-
* <p>This is a wrapper structure to contain schema identity fields. The structure contains:</p>
8355-
* <ul>
8356-
* <li>
8357-
* <p>SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p>
8358-
* </li>
8359-
* <li>
8360-
* <p>SchemaId$SchemaName: The name of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p>
8361-
* </li>
8362-
* </ul>
8363-
* @public
8364-
*/
8365-
SchemaId: SchemaId | undefined;
8366-
8367-
/**
8368-
* <p>The definition of the schema for which schema details are required.</p>
8369-
* @public
8370-
*/
8371-
SchemaDefinition: string | undefined;
8372-
}
8373-
8374-
/**
8375-
* @public
8376-
*/
8377-
export interface GetSchemaByDefinitionResponse {
8378-
/**
8379-
* <p>The schema ID of the schema version.</p>
8380-
* @public
8381-
*/
8382-
SchemaVersionId?: string;
8383-
8384-
/**
8385-
* <p>The Amazon Resource Name (ARN) of the schema.</p>
8386-
* @public
8387-
*/
8388-
SchemaArn?: string;
8389-
8390-
/**
8391-
* <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
8392-
* @public
8393-
*/
8394-
DataFormat?: DataFormat;
8395-
8396-
/**
8397-
* <p>The status of the schema version.</p>
8398-
* @public
8399-
*/
8400-
Status?: SchemaVersionStatus;
8401-
8402-
/**
8403-
* <p>The date and time the schema was created.</p>
8404-
* @public
8405-
*/
8406-
CreatedTime?: string;
8407-
}

0 commit comments

Comments
 (0)