Skip to content

Commit

Permalink
feat(client-glue): This release adds support for creating and updatin…
Browse files Browse the repository at this point in the history
…g Glue Data Catalog Views.
  • Loading branch information
awstools committed Jun 6, 2024
1 parent ec83f87 commit 349fcc9
Show file tree
Hide file tree
Showing 14 changed files with 458 additions and 161 deletions.
16 changes: 16 additions & 0 deletions clients/client-glue/src/commands/CreateTableCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ export interface CreateTableCommandOutput extends CreateTableResponse, __Metadat
* Name: "STRING_VALUE",
* Region: "STRING_VALUE",
* },
* ViewDefinition: { // ViewDefinitionInput
* IsProtected: true || false,
* Definer: "STRING_VALUE",
* Representations: [ // ViewRepresentationInputList
* { // ViewRepresentationInput
* Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
* DialectVersion: "STRING_VALUE",
* ViewOriginalText: "STRING_VALUE",
* ValidationConnection: "STRING_VALUE",
* ViewExpandedText: "STRING_VALUE",
* },
* ],
* SubObjects: [ // ViewSubObjectsList
* "STRING_VALUE",
* ],
* },
* },
* PartitionIndexes: [ // PartitionIndexList
* { // PartitionIndex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { GlueClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GlueClient";
import { GetSchemaByDefinitionInput, GetSchemaByDefinitionResponse } from "../models/models_1";
import { GetSchemaByDefinitionInput, GetSchemaByDefinitionResponse } from "../models/models_2";
import { de_GetSchemaByDefinitionCommand, se_GetSchemaByDefinitionCommand } from "../protocols/Aws_json1_1";

/**
Expand Down
3 changes: 2 additions & 1 deletion clients/client-glue/src/commands/GetSchemaCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { GlueClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GlueClient";
import { GetSchemaInput, GetSchemaResponse } from "../models/models_1";
import { GetSchemaInput } from "../models/models_1";
import { GetSchemaResponse } from "../models/models_2";
import { de_GetSchemaCommand, se_GetSchemaCommand } from "../protocols/Aws_json1_1";

/**
Expand Down
1 change: 1 addition & 0 deletions clients/client-glue/src/commands/GetTableCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export interface GetTableCommandOutput extends GetTableResponse, __MetadataBeare
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // ValidationConnection: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
Expand Down
1 change: 1 addition & 0 deletions clients/client-glue/src/commands/GetTableVersionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export interface GetTableVersionCommandOutput extends GetTableVersionResponse, _
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // ValidationConnection: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export interface GetTableVersionsCommandOutput extends GetTableVersionsResponse,
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // ValidationConnection: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
Expand Down
1 change: 1 addition & 0 deletions clients/client-glue/src/commands/GetTablesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export interface GetTablesCommandOutput extends GetTablesResponse, __MetadataBea
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // ValidationConnection: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export interface GetUnfilteredTableMetadataCommandOutput extends GetUnfilteredTa
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // ValidationConnection: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
Expand Down
1 change: 1 addition & 0 deletions clients/client-glue/src/commands/SearchTablesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export interface SearchTablesCommandOutput extends SearchTablesResponse, __Metad
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // ValidationConnection: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
Expand Down
18 changes: 18 additions & 0 deletions clients/client-glue/src/commands/UpdateTableCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,28 @@ export interface UpdateTableCommandOutput extends UpdateTableResponse, __Metadat
* Name: "STRING_VALUE",
* Region: "STRING_VALUE",
* },
* ViewDefinition: { // ViewDefinitionInput
* IsProtected: true || false,
* Definer: "STRING_VALUE",
* Representations: [ // ViewRepresentationInputList
* { // ViewRepresentationInput
* Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
* DialectVersion: "STRING_VALUE",
* ViewOriginalText: "STRING_VALUE",
* ValidationConnection: "STRING_VALUE",
* ViewExpandedText: "STRING_VALUE",
* },
* ],
* SubObjects: [ // ViewSubObjectsList
* "STRING_VALUE",
* ],
* },
* },
* SkipArchive: true || false,
* TransactionId: "STRING_VALUE",
* VersionId: "STRING_VALUE",
* ViewUpdateAction: "ADD" || "REPLACE" || "ADD_OR_REPLACE" || "DROP",
* Force: true || false,
* };
* const command = new UpdateTableCommand(input);
* const response = await client.send(command);
Expand Down
230 changes: 87 additions & 143 deletions clients/client-glue/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2455,6 +2455,87 @@ export interface TableIdentifier {
Region?: string;
}

/**
* @public
* @enum
*/
export const ViewDialect = {
ATHENA: "ATHENA",
REDSHIFT: "REDSHIFT",
SPARK: "SPARK",
} as const;

/**
* @public
*/
export type ViewDialect = (typeof ViewDialect)[keyof typeof ViewDialect];

/**
* <p>A structure containing details of a representation to update or create a Lake Formation view.</p>
* @public
*/
export interface ViewRepresentationInput {
/**
* <p>A parameter that specifies the engine type of a specific representation.</p>
* @public
*/
Dialect?: ViewDialect;

/**
* <p>A parameter that specifies the version of the engine of a specific representation.</p>
* @public
*/
DialectVersion?: string;

/**
* <p>A string that represents the original SQL query that describes the view.</p>
* @public
*/
ViewOriginalText?: string;

/**
* <p>The name of the connection to be used to validate the specific representation of the view.</p>
* @public
*/
ValidationConnection?: string;

/**
* <p>A string that represents the SQL query that describes the view with expanded resource ARNs</p>
* @public
*/
ViewExpandedText?: string;
}

/**
* <p>A structure containing details for creating or updating an Glue view.</p>
* @public
*/
export interface ViewDefinitionInput {
/**
* <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>
* @public
*/
IsProtected?: boolean;

/**
* <p>The definer of a view in SQL.</p>
* @public
*/
Definer?: string;

/**
* <p>A list of structures that contains the dialect of the view, and the query that defines the view.</p>
* @public
*/
Representations?: ViewRepresentationInput[];

/**
* <p>A list of base table ARNs that make up the view.</p>
* @public
*/
SubObjects?: string[];
}

/**
* <p>A structure used to define a table.</p>
* @public
Expand Down Expand Up @@ -2562,6 +2643,12 @@ export interface TableInput {
* @public
*/
TargetTable?: TableIdentifier;

/**
* <p>A structure that contains all the information that defines the view, including the dialect or dialects for the view, and the query.</p>
* @public
*/
ViewDefinition?: ViewDefinitionInput;
}

/**
Expand Down Expand Up @@ -8262,146 +8349,3 @@ export interface GetSchemaInput {
*/
SchemaId: SchemaId | undefined;
}

/**
* @public
*/
export interface GetSchemaResponse {
/**
* <p>The name of the registry.</p>
* @public
*/
RegistryName?: string;

/**
* <p>The Amazon Resource Name (ARN) of the registry.</p>
* @public
*/
RegistryArn?: string;

/**
* <p>The name of the schema.</p>
* @public
*/
SchemaName?: string;

/**
* <p>The Amazon Resource Name (ARN) of the schema.</p>
* @public
*/
SchemaArn?: string;

/**
* <p>A description of schema if specified when created</p>
* @public
*/
Description?: string;

/**
* <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
* @public
*/
DataFormat?: DataFormat;

/**
* <p>The compatibility mode of the schema.</p>
* @public
*/
Compatibility?: Compatibility;

/**
* <p>The version number of the checkpoint (the last time the compatibility mode was changed).</p>
* @public
*/
SchemaCheckpoint?: number;

/**
* <p>The latest version of the schema associated with the returned schema definition.</p>
* @public
*/
LatestSchemaVersion?: number;

/**
* <p>The next version of the schema associated with the returned schema definition.</p>
* @public
*/
NextSchemaVersion?: number;

/**
* <p>The status of the schema.</p>
* @public
*/
SchemaStatus?: SchemaStatus;

/**
* <p>The date and time the schema was created.</p>
* @public
*/
CreatedTime?: string;

/**
* <p>The date and time the schema was updated.</p>
* @public
*/
UpdatedTime?: string;
}

/**
* @public
*/
export interface GetSchemaByDefinitionInput {
/**
* <p>This is a wrapper structure to contain schema identity fields. The structure contains:</p>
* <ul>
* <li>
* <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>
* </li>
* <li>
* <p>SchemaId$SchemaName: The name of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p>
* </li>
* </ul>
* @public
*/
SchemaId: SchemaId | undefined;

/**
* <p>The definition of the schema for which schema details are required.</p>
* @public
*/
SchemaDefinition: string | undefined;
}

/**
* @public
*/
export interface GetSchemaByDefinitionResponse {
/**
* <p>The schema ID of the schema version.</p>
* @public
*/
SchemaVersionId?: string;

/**
* <p>The Amazon Resource Name (ARN) of the schema.</p>
* @public
*/
SchemaArn?: string;

/**
* <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
* @public
*/
DataFormat?: DataFormat;

/**
* <p>The status of the schema version.</p>
* @public
*/
Status?: SchemaVersionStatus;

/**
* <p>The date and time the schema was created.</p>
* @public
*/
CreatedTime?: string;
}
Loading

0 comments on commit 349fcc9

Please sign in to comment.