Skip to content

Commit

Permalink
feat(client-glue): Adding View related fields to responses of read-on…
Browse files Browse the repository at this point in the history
…ly Table APIs.
  • Loading branch information
awstools committed Apr 2, 2024
1 parent 5c8d5ee commit 813eb4d
Show file tree
Hide file tree
Showing 9 changed files with 347 additions and 15 deletions.
17 changes: 17 additions & 0 deletions clients/client-glue/src/commands/GetTableCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,23 @@ export interface GetTableCommandOutput extends GetTableResponse, __MetadataBeare
* // DatabaseIdentifier: "STRING_VALUE",
* // ConnectionName: "STRING_VALUE",
* // },
* // ViewDefinition: { // ViewDefinition
* // IsProtected: true || false,
* // Definer: "STRING_VALUE",
* // SubObjects: [ // ViewSubObjectsList
* // "STRING_VALUE",
* // ],
* // Representations: [ // ViewRepresentationList
* // { // ViewRepresentation
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
* // },
* // IsMultiDialectView: true || false,
* // },
* // };
*
Expand Down
17 changes: 17 additions & 0 deletions clients/client-glue/src/commands/GetTableVersionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,23 @@ export interface GetTableVersionCommandOutput extends GetTableVersionResponse, _
* // DatabaseIdentifier: "STRING_VALUE",
* // ConnectionName: "STRING_VALUE",
* // },
* // ViewDefinition: { // ViewDefinition
* // IsProtected: true || false,
* // Definer: "STRING_VALUE",
* // SubObjects: [ // ViewSubObjectsList
* // "STRING_VALUE",
* // ],
* // Representations: [ // ViewRepresentationList
* // { // ViewRepresentation
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
* // },
* // IsMultiDialectView: true || false,
* // },
* // VersionId: "STRING_VALUE",
* // },
Expand Down
17 changes: 17 additions & 0 deletions clients/client-glue/src/commands/GetTableVersionsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,23 @@ export interface GetTableVersionsCommandOutput extends GetTableVersionsResponse,
* // DatabaseIdentifier: "STRING_VALUE",
* // ConnectionName: "STRING_VALUE",
* // },
* // ViewDefinition: { // ViewDefinition
* // IsProtected: true || false,
* // Definer: "STRING_VALUE",
* // SubObjects: [ // ViewSubObjectsList
* // "STRING_VALUE",
* // ],
* // Representations: [ // ViewRepresentationList
* // { // ViewRepresentation
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
* // },
* // IsMultiDialectView: true || false,
* // },
* // VersionId: "STRING_VALUE",
* // },
Expand Down
17 changes: 17 additions & 0 deletions clients/client-glue/src/commands/GetTablesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,23 @@ export interface GetTablesCommandOutput extends GetTablesResponse, __MetadataBea
* // DatabaseIdentifier: "STRING_VALUE",
* // ConnectionName: "STRING_VALUE",
* // },
* // ViewDefinition: { // ViewDefinition
* // IsProtected: true || false,
* // Definer: "STRING_VALUE",
* // SubObjects: [ // ViewSubObjectsList
* // "STRING_VALUE",
* // ],
* // Representations: [ // ViewRepresentationList
* // { // ViewRepresentation
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
* // },
* // IsMultiDialectView: true || false,
* // },
* // ],
* // NextToken: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,23 @@ export interface GetUnfilteredTableMetadataCommandOutput extends GetUnfilteredTa
* // DatabaseIdentifier: "STRING_VALUE",
* // ConnectionName: "STRING_VALUE",
* // },
* // ViewDefinition: { // ViewDefinition
* // IsProtected: true || false,
* // Definer: "STRING_VALUE",
* // SubObjects: [ // ViewSubObjectsList
* // "STRING_VALUE",
* // ],
* // Representations: [ // ViewRepresentationList
* // { // ViewRepresentation
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
* // },
* // IsMultiDialectView: true || false,
* // },
* // AuthorizedColumns: "<NameStringList>",
* // IsRegisteredWithLakeFormation: true || false,
Expand All @@ -176,7 +193,9 @@ export interface GetUnfilteredTableMetadataCommandOutput extends GetUnfilteredTa
* // },
* // ],
* // QueryAuthorizationId: "STRING_VALUE",
* // IsMultiDialectView: true || false,
* // ResourceArn: "STRING_VALUE",
* // IsProtected: true || false,
* // Permissions: [ // PermissionList
* // "ALL" || "SELECT" || "ALTER" || "DROP" || "DELETE" || "INSERT" || "CREATE_DATABASE" || "CREATE_TABLE" || "DATA_LOCATION_ACCESS",
* // ],
Expand Down
17 changes: 17 additions & 0 deletions clients/client-glue/src/commands/SearchTablesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,23 @@ export interface SearchTablesCommandOutput extends SearchTablesResponse, __Metad
* // DatabaseIdentifier: "STRING_VALUE",
* // ConnectionName: "STRING_VALUE",
* // },
* // ViewDefinition: { // ViewDefinition
* // IsProtected: true || false,
* // Definer: "STRING_VALUE",
* // SubObjects: [ // ViewSubObjectsList
* // "STRING_VALUE",
* // ],
* // Representations: [ // ViewRepresentationList
* // { // ViewRepresentation
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
* // DialectVersion: "STRING_VALUE",
* // ViewOriginalText: "STRING_VALUE",
* // ViewExpandedText: "STRING_VALUE",
* // IsStale: true || false,
* // },
* // ],
* // },
* // IsMultiDialectView: true || false,
* // },
* // ],
* // };
Expand Down
126 changes: 111 additions & 15 deletions clients/client-glue/src/models/models_2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,93 @@ export interface FederatedTable {
ConnectionName?: 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 that contains the dialect of the view, and the query that defines the view.</p>
* @public
*/
export interface ViewRepresentation {
/**
* <p>The dialect of the query engine.</p>
* @public
*/
Dialect?: ViewDialect;

/**
* <p>The version of the dialect of the query engine. For example, 3.0.0.</p>
* @public
*/
DialectVersion?: string;

/**
* <p>The <code>SELECT</code> query provided by the customer during <code>CREATE VIEW DDL</code>. This SQL is not used during a query on a view (<code>ViewExpandedText</code> is used instead). <code>ViewOriginalText</code> is used for cases like <code>SHOW CREATE VIEW</code> where users want to see the original DDL command that created the view.</p>
* @public
*/
ViewOriginalText?: string;

/**
* <p>The expanded SQL for the view. This SQL is used by engines while processing a query on a view. Engines may perform operations during view creation to transform <code>ViewOriginalText</code> to <code>ViewExpandedText</code>. For example:</p>
* <ul>
* <li>
* <p>Fully qualify identifiers: <code>SELECT * from table1 → SELECT * from db1.table1</code>
* </p>
* </li>
* </ul>
* @public
*/
ViewExpandedText?: string;

/**
* <p>Dialects marked as stale are no longer valid and must be updated before they can be queried in their respective query engines.</p>
* @public
*/
IsStale?: boolean;
}

/**
* <p>A structure containing details for representations.</p>
* @public
*/
export interface ViewDefinition {
/**
* <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 table Amazon Resource Names (ARNs).</p>
* @public
*/
SubObjects?: string[];

/**
* <p>A list of representations.</p>
* @public
*/
Representations?: ViewRepresentation[];
}

/**
* <p>Represents a collection of related data organized in columns and rows.</p>
* @public
Expand Down Expand Up @@ -560,6 +647,18 @@ export interface Table {
* @public
*/
FederatedTable?: FederatedTable;

/**
* <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?: ViewDefinition;

/**
* <p>Specifies whether the view supports the SQL dialects of one or more different query engines and can therefore be read by those engines.</p>
* @public
*/
IsMultiDialectView?: boolean;
}

/**
Expand Down Expand Up @@ -1273,21 +1372,6 @@ export interface GetUnfilteredPartitionsMetadataResponse {
NextToken?: 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 specifying the dialect and dialect version used by the query engine.</p>
* @public
Expand Down Expand Up @@ -1418,12 +1502,24 @@ export interface GetUnfilteredTableMetadataResponse {
*/
QueryAuthorizationId?: string;

/**
* <p>Specifies whether the view supports the SQL dialects of one or more different query engines and can therefore be read by those engines.</p>
* @public
*/
IsMultiDialectView?: boolean;

/**
* <p>The resource ARN of the parent resource extracted from the request.</p>
* @public
*/
ResourceArn?: string;

/**
* <p>A flag that instructs the engine not to push user-provided operations into the logical plan of the view during query planning. However, if set 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 Lake Formation data permissions of the caller on the table. Used to authorize the call when no view context is found.</p>
* @public
Expand Down
12 changes: 12 additions & 0 deletions clients/client-glue/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13003,6 +13003,8 @@ const de_GetUnfilteredTableMetadataResponse = (
return take(output, {
AuthorizedColumns: _json,
CellFilters: _json,
IsMultiDialectView: __expectBoolean,
IsProtected: __expectBoolean,
IsRegisteredWithLakeFormation: __expectBoolean,
Permissions: _json,
QueryAuthorizationId: __expectString,
Expand Down Expand Up @@ -14069,6 +14071,7 @@ const de_Table = (output: any, context: __SerdeContext): Table => {
DatabaseName: __expectString,
Description: __expectString,
FederatedTable: _json,
IsMultiDialectView: __expectBoolean,
IsRegisteredWithLakeFormation: __expectBoolean,
LastAccessTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
LastAnalyzedTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Expand All @@ -14082,6 +14085,7 @@ const de_Table = (output: any, context: __SerdeContext): Table => {
TargetTable: _json,
UpdateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
VersionId: __expectString,
ViewDefinition: _json,
ViewExpandedText: __expectString,
ViewOriginalText: __expectString,
}) as any;
Expand Down Expand Up @@ -14362,6 +14366,14 @@ const de_UserDefinedFunctionList = (output: any, context: __SerdeContext): UserD

// de_VersionMismatchException omitted.

// de_ViewDefinition omitted.

// de_ViewRepresentation omitted.

// de_ViewRepresentationList omitted.

// de_ViewSubObjectsList omitted.

/**
* deserializeAws_json1_1Workflow
*/
Expand Down
Loading

0 comments on commit 813eb4d

Please sign in to comment.