tacnode

AWS Glue Foreign Table

AWS Glue functions as a metadata management service utilizing a data lake. Tacnode can connect to Glue’s metadata through external tables, enabling faster queries and efficient data import.

Installing the extension

Install the extension once. If it has already been installed, you can skip this step.

CREATE EXTENSION glue_fdw;

Create a Glue Foreign Server

CREATE SERVER <server_name> FOREIGN DATA WRAPPER glue_fdw
OPTIONS (
 REGION 'region-id'
);
  • REGION: The region ID of the cloud storage service. For specific IDs, see AWS S3 Endpoint.
-- Example
CREATE SERVER glue_server FOREIGN DATA WRAPPER glue_fdw
OPTIONS (
 REGION 'us-east-1'
);

Create User Mapping

Using 'access_id' and 'access_key', grant the local user account access rights to the designated object storage.

CREATE USER MAPPING for public SERVER glue_server
OPTIONS (
 ACCESS_ID 'access-id',
 ACCESS_KEY 'access-key'
);

Creating a foreign table

-- Create the external table t1 under glue_db, storing metadata in the public schema.
IMPORT FOREIGN SCHEMA glue_db LIMIT TO(t1) FROM SERVER glue_server INTO public;

On this page