Skip to content

Commit 813eb4d

Browse files
author
awstools
committed
feat(client-glue): Adding View related fields to responses of read-only Table APIs.
1 parent 5c8d5ee commit 813eb4d

File tree

9 files changed

+347
-15
lines changed

9 files changed

+347
-15
lines changed

Diff for: clients/client-glue/src/commands/GetTableCommand.ts

+17
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,23 @@ export interface GetTableCommandOutput extends GetTableResponse, __MetadataBeare
140140
* // DatabaseIdentifier: "STRING_VALUE",
141141
* // ConnectionName: "STRING_VALUE",
142142
* // },
143+
* // ViewDefinition: { // ViewDefinition
144+
* // IsProtected: true || false,
145+
* // Definer: "STRING_VALUE",
146+
* // SubObjects: [ // ViewSubObjectsList
147+
* // "STRING_VALUE",
148+
* // ],
149+
* // Representations: [ // ViewRepresentationList
150+
* // { // ViewRepresentation
151+
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
152+
* // DialectVersion: "STRING_VALUE",
153+
* // ViewOriginalText: "STRING_VALUE",
154+
* // ViewExpandedText: "STRING_VALUE",
155+
* // IsStale: true || false,
156+
* // },
157+
* // ],
158+
* // },
159+
* // IsMultiDialectView: true || false,
143160
* // },
144161
* // };
145162
*

Diff for: clients/client-glue/src/commands/GetTableVersionCommand.ts

+17
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,23 @@ export interface GetTableVersionCommandOutput extends GetTableVersionResponse, _
139139
* // DatabaseIdentifier: "STRING_VALUE",
140140
* // ConnectionName: "STRING_VALUE",
141141
* // },
142+
* // ViewDefinition: { // ViewDefinition
143+
* // IsProtected: true || false,
144+
* // Definer: "STRING_VALUE",
145+
* // SubObjects: [ // ViewSubObjectsList
146+
* // "STRING_VALUE",
147+
* // ],
148+
* // Representations: [ // ViewRepresentationList
149+
* // { // ViewRepresentation
150+
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
151+
* // DialectVersion: "STRING_VALUE",
152+
* // ViewOriginalText: "STRING_VALUE",
153+
* // ViewExpandedText: "STRING_VALUE",
154+
* // IsStale: true || false,
155+
* // },
156+
* // ],
157+
* // },
158+
* // IsMultiDialectView: true || false,
142159
* // },
143160
* // VersionId: "STRING_VALUE",
144161
* // },

Diff for: clients/client-glue/src/commands/GetTableVersionsCommand.ts

+17
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,23 @@ export interface GetTableVersionsCommandOutput extends GetTableVersionsResponse,
142142
* // DatabaseIdentifier: "STRING_VALUE",
143143
* // ConnectionName: "STRING_VALUE",
144144
* // },
145+
* // ViewDefinition: { // ViewDefinition
146+
* // IsProtected: true || false,
147+
* // Definer: "STRING_VALUE",
148+
* // SubObjects: [ // ViewSubObjectsList
149+
* // "STRING_VALUE",
150+
* // ],
151+
* // Representations: [ // ViewRepresentationList
152+
* // { // ViewRepresentation
153+
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
154+
* // DialectVersion: "STRING_VALUE",
155+
* // ViewOriginalText: "STRING_VALUE",
156+
* // ViewExpandedText: "STRING_VALUE",
157+
* // IsStale: true || false,
158+
* // },
159+
* // ],
160+
* // },
161+
* // IsMultiDialectView: true || false,
145162
* // },
146163
* // VersionId: "STRING_VALUE",
147164
* // },

Diff for: clients/client-glue/src/commands/GetTablesCommand.ts

+17
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,23 @@ export interface GetTablesCommandOutput extends GetTablesResponse, __MetadataBea
143143
* // DatabaseIdentifier: "STRING_VALUE",
144144
* // ConnectionName: "STRING_VALUE",
145145
* // },
146+
* // ViewDefinition: { // ViewDefinition
147+
* // IsProtected: true || false,
148+
* // Definer: "STRING_VALUE",
149+
* // SubObjects: [ // ViewSubObjectsList
150+
* // "STRING_VALUE",
151+
* // ],
152+
* // Representations: [ // ViewRepresentationList
153+
* // { // ViewRepresentation
154+
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
155+
* // DialectVersion: "STRING_VALUE",
156+
* // ViewOriginalText: "STRING_VALUE",
157+
* // ViewExpandedText: "STRING_VALUE",
158+
* // IsStale: true || false,
159+
* // },
160+
* // ],
161+
* // },
162+
* // IsMultiDialectView: true || false,
146163
* // },
147164
* // ],
148165
* // NextToken: "STRING_VALUE",

Diff for: clients/client-glue/src/commands/GetUnfilteredTableMetadataCommand.ts

+19
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,23 @@ export interface GetUnfilteredTableMetadataCommandOutput extends GetUnfilteredTa
166166
* // DatabaseIdentifier: "STRING_VALUE",
167167
* // ConnectionName: "STRING_VALUE",
168168
* // },
169+
* // ViewDefinition: { // ViewDefinition
170+
* // IsProtected: true || false,
171+
* // Definer: "STRING_VALUE",
172+
* // SubObjects: [ // ViewSubObjectsList
173+
* // "STRING_VALUE",
174+
* // ],
175+
* // Representations: [ // ViewRepresentationList
176+
* // { // ViewRepresentation
177+
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
178+
* // DialectVersion: "STRING_VALUE",
179+
* // ViewOriginalText: "STRING_VALUE",
180+
* // ViewExpandedText: "STRING_VALUE",
181+
* // IsStale: true || false,
182+
* // },
183+
* // ],
184+
* // },
185+
* // IsMultiDialectView: true || false,
169186
* // },
170187
* // AuthorizedColumns: "<NameStringList>",
171188
* // IsRegisteredWithLakeFormation: true || false,
@@ -176,7 +193,9 @@ export interface GetUnfilteredTableMetadataCommandOutput extends GetUnfilteredTa
176193
* // },
177194
* // ],
178195
* // QueryAuthorizationId: "STRING_VALUE",
196+
* // IsMultiDialectView: true || false,
179197
* // ResourceArn: "STRING_VALUE",
198+
* // IsProtected: true || false,
180199
* // Permissions: [ // PermissionList
181200
* // "ALL" || "SELECT" || "ALTER" || "DROP" || "DELETE" || "INSERT" || "CREATE_DATABASE" || "CREATE_TABLE" || "DATA_LOCATION_ACCESS",
182201
* // ],

Diff for: clients/client-glue/src/commands/SearchTablesCommand.ts

+17
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,23 @@ export interface SearchTablesCommandOutput extends SearchTablesResponse, __Metad
155155
* // DatabaseIdentifier: "STRING_VALUE",
156156
* // ConnectionName: "STRING_VALUE",
157157
* // },
158+
* // ViewDefinition: { // ViewDefinition
159+
* // IsProtected: true || false,
160+
* // Definer: "STRING_VALUE",
161+
* // SubObjects: [ // ViewSubObjectsList
162+
* // "STRING_VALUE",
163+
* // ],
164+
* // Representations: [ // ViewRepresentationList
165+
* // { // ViewRepresentation
166+
* // Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
167+
* // DialectVersion: "STRING_VALUE",
168+
* // ViewOriginalText: "STRING_VALUE",
169+
* // ViewExpandedText: "STRING_VALUE",
170+
* // IsStale: true || false,
171+
* // },
172+
* // ],
173+
* // },
174+
* // IsMultiDialectView: true || false,
158175
* // },
159176
* // ],
160177
* // };

Diff for: clients/client-glue/src/models/models_2.ts

+111-15
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,93 @@ export interface FederatedTable {
403403
ConnectionName?: string;
404404
}
405405

406+
/**
407+
* @public
408+
* @enum
409+
*/
410+
export const ViewDialect = {
411+
ATHENA: "ATHENA",
412+
REDSHIFT: "REDSHIFT",
413+
SPARK: "SPARK",
414+
} as const;
415+
416+
/**
417+
* @public
418+
*/
419+
export type ViewDialect = (typeof ViewDialect)[keyof typeof ViewDialect];
420+
421+
/**
422+
* <p>A structure that contains the dialect of the view, and the query that defines the view.</p>
423+
* @public
424+
*/
425+
export interface ViewRepresentation {
426+
/**
427+
* <p>The dialect of the query engine.</p>
428+
* @public
429+
*/
430+
Dialect?: ViewDialect;
431+
432+
/**
433+
* <p>The version of the dialect of the query engine. For example, 3.0.0.</p>
434+
* @public
435+
*/
436+
DialectVersion?: string;
437+
438+
/**
439+
* <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>
440+
* @public
441+
*/
442+
ViewOriginalText?: string;
443+
444+
/**
445+
* <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>
446+
* <ul>
447+
* <li>
448+
* <p>Fully qualify identifiers: <code>SELECT * from table1 → SELECT * from db1.table1</code>
449+
* </p>
450+
* </li>
451+
* </ul>
452+
* @public
453+
*/
454+
ViewExpandedText?: string;
455+
456+
/**
457+
* <p>Dialects marked as stale are no longer valid and must be updated before they can be queried in their respective query engines.</p>
458+
* @public
459+
*/
460+
IsStale?: boolean;
461+
}
462+
463+
/**
464+
* <p>A structure containing details for representations.</p>
465+
* @public
466+
*/
467+
export interface ViewDefinition {
468+
/**
469+
* <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>
470+
* @public
471+
*/
472+
IsProtected?: boolean;
473+
474+
/**
475+
* <p>The definer of a view in SQL.</p>
476+
* @public
477+
*/
478+
Definer?: string;
479+
480+
/**
481+
* <p>A list of table Amazon Resource Names (ARNs).</p>
482+
* @public
483+
*/
484+
SubObjects?: string[];
485+
486+
/**
487+
* <p>A list of representations.</p>
488+
* @public
489+
*/
490+
Representations?: ViewRepresentation[];
491+
}
492+
406493
/**
407494
* <p>Represents a collection of related data organized in columns and rows.</p>
408495
* @public
@@ -560,6 +647,18 @@ export interface Table {
560647
* @public
561648
*/
562649
FederatedTable?: FederatedTable;
650+
651+
/**
652+
* <p>A structure that contains all the information that defines the view, including the dialect or dialects for the view, and the query.</p>
653+
* @public
654+
*/
655+
ViewDefinition?: ViewDefinition;
656+
657+
/**
658+
* <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>
659+
* @public
660+
*/
661+
IsMultiDialectView?: boolean;
563662
}
564663

565664
/**
@@ -1273,21 +1372,6 @@ export interface GetUnfilteredPartitionsMetadataResponse {
12731372
NextToken?: string;
12741373
}
12751374

1276-
/**
1277-
* @public
1278-
* @enum
1279-
*/
1280-
export const ViewDialect = {
1281-
ATHENA: "ATHENA",
1282-
REDSHIFT: "REDSHIFT",
1283-
SPARK: "SPARK",
1284-
} as const;
1285-
1286-
/**
1287-
* @public
1288-
*/
1289-
export type ViewDialect = (typeof ViewDialect)[keyof typeof ViewDialect];
1290-
12911375
/**
12921376
* <p>A structure specifying the dialect and dialect version used by the query engine.</p>
12931377
* @public
@@ -1418,12 +1502,24 @@ export interface GetUnfilteredTableMetadataResponse {
14181502
*/
14191503
QueryAuthorizationId?: string;
14201504

1505+
/**
1506+
* <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>
1507+
* @public
1508+
*/
1509+
IsMultiDialectView?: boolean;
1510+
14211511
/**
14221512
* <p>The resource ARN of the parent resource extracted from the request.</p>
14231513
* @public
14241514
*/
14251515
ResourceArn?: string;
14261516

1517+
/**
1518+
* <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>
1519+
* @public
1520+
*/
1521+
IsProtected?: boolean;
1522+
14271523
/**
14281524
* <p>The Lake Formation data permissions of the caller on the table. Used to authorize the call when no view context is found.</p>
14291525
* @public

Diff for: clients/client-glue/src/protocols/Aws_json1_1.ts

+12
Original file line numberDiff line numberDiff line change
@@ -13003,6 +13003,8 @@ const de_GetUnfilteredTableMetadataResponse = (
1300313003
return take(output, {
1300413004
AuthorizedColumns: _json,
1300513005
CellFilters: _json,
13006+
IsMultiDialectView: __expectBoolean,
13007+
IsProtected: __expectBoolean,
1300613008
IsRegisteredWithLakeFormation: __expectBoolean,
1300713009
Permissions: _json,
1300813010
QueryAuthorizationId: __expectString,
@@ -14069,6 +14071,7 @@ const de_Table = (output: any, context: __SerdeContext): Table => {
1406914071
DatabaseName: __expectString,
1407014072
Description: __expectString,
1407114073
FederatedTable: _json,
14074+
IsMultiDialectView: __expectBoolean,
1407214075
IsRegisteredWithLakeFormation: __expectBoolean,
1407314076
LastAccessTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1407414077
LastAnalyzedTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
@@ -14082,6 +14085,7 @@ const de_Table = (output: any, context: __SerdeContext): Table => {
1408214085
TargetTable: _json,
1408314086
UpdateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1408414087
VersionId: __expectString,
14088+
ViewDefinition: _json,
1408514089
ViewExpandedText: __expectString,
1408614090
ViewOriginalText: __expectString,
1408714091
}) as any;
@@ -14362,6 +14366,14 @@ const de_UserDefinedFunctionList = (output: any, context: __SerdeContext): UserD
1436214366

1436314367
// de_VersionMismatchException omitted.
1436414368

14369+
// de_ViewDefinition omitted.
14370+
14371+
// de_ViewRepresentation omitted.
14372+
14373+
// de_ViewRepresentationList omitted.
14374+
14375+
// de_ViewSubObjectsList omitted.
14376+
1436514377
/**
1436614378
* deserializeAws_json1_1Workflow
1436714379
*/

0 commit comments

Comments
 (0)