Skip to content

Glue: GetTable/GetTables on a resource link read through to the target table - #10102

Open
Rishi943 wants to merge 1 commit into
getmoto:masterfrom
Rishi943:feat/glue-resource-link-read-through
Open

Glue: GetTable/GetTables on a resource link read through to the target table#10102
Rishi943 wants to merge 1 commit into
getmoto:masterfrom
Rishi943:feat/glue-resource-link-read-through

Conversation

@Rishi943

Copy link
Copy Markdown

Fixes #8868

Real AWS Glue reads through resource links: GetTable on a table whose definition contains a TargetTable merges schema/storage information from the target table into the response (see the Lake Formation docs on resource links), while keeping the link's own Name/DatabaseName/TargetTable. Moto previously returned only what was supplied at creation.

This PR implements the read-through in FakeTable.as_dict(), so it covers GetTable, GetTables, and GetTableVersion(s) in one place:

  • StorageDescriptor, PartitionKeys, TableType, and Parameters are merged from the target table (single hop — a link pointing at another link is not chased).
  • The link's own identity fields are preserved.
  • If the target database/table doesn't exist, the link is returned as-is (current behavior).

Tests cover GetTable on a link (merged schema + TargetTable present), GetTables, and a link with a missing target.

…t table

Real AWS Glue merges schema/storage information (StorageDescriptor,
PartitionKeys, TableType, Parameters) from the target table into the
response when fetching a resource link, while keeping the link's own
Name/DatabaseName/TargetTable. Moto previously returned only what was
supplied at creation. If the target does not exist, the link is
returned as-is.

Fixes getmoto#8868

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Glue] Read-through behavior of Resource Links in glue metastore

1 participant