All skills
aws avatar

/ingesting-into-data-lake

@b33847d

Import data into the AWS data lake from S3 files, local uploads, JDBC databases (Oracle, SQL Server, PostgreSQL, MySQL, RDS, Aurora), Amazon Redshift, Snowflake, BigQuery, DynamoDB, or existing Glue catalog tables (migration). Default target is S3 Tables; standard Iceberg on a general purpose bucket is supported where S3 Tables is not adopted. Handles one-time loads, recurring pipelines, migrations. Triggers on: import data, load data, ingest, sync database, migrate table, move data to AWS, set up pipeline, ETL, pull from Snowflake, query BigQuery into S3, export DynamoDB, CTAS, convert to Iceberg. Do NOT use for setting up or troubleshooting Glue connections (use connecting-to-data-source), creating empty tables (use creating-data-lake-table), running queries (use querying-data-lake), finding tables by fuzzy name (use finding-data-lake-assets), catalog audit (use exploring-data-catalog), or SaaS platforms like Salesforce, ServiceNow, SAP, MongoDB, Kafka.

Use this Skill: https://skilld.dev/gh/aws/agent-toolkit-for-aws/ingesting-into-data-lake

This session only. Nothing lands on disk.

referencesbigquery-ingest.md

≈949 tokens on demand. Your agent reads this file only when SKILL.md points to it.

BigQuery Ingest

Move data from Google BigQuery into the data lake. Assumes a Glue BIGQUERY connection exists. If not, delegate to connecting-to-data-source.

Contents

Prerequisites

  • Glue connection of type BIGQUERY with service account credentials in Secrets Manager
  • GCP project ID and source table (full form: project.dataset.table)
  • Target table in the data lake
  • Egress from the Glue subnet to bigquery.googleapis.com (public internet or Google Private Service Connect)

Read Pattern

bigquery_df = glueContext.create_dynamic_frame.from_options(
    connection_type="bigquery",
    connection_options={
        "connectionName": args['connection_name'],
        "parentProject": args['gcp_project'],
        "sourceType": "table",
        "table": "my_dataset.customers"
    }
).toDF()

For custom SQL:

connection_options={
    "connectionName": args['connection_name'],
    "parentProject": args['gcp_project'],
    "sourceType": "query",
    "query": "SELECT id, name, updated_at FROM `project.dataset.customers` WHERE country = 'US'"
}

BigQuery billing note: the query reads bytes from table storage. Filter aggressively at source to minimize bytes scanned.

Incremental Loading

BigQuery has strong timestamp semantics. Watermark columns commonly used:

  • Application-maintained updated_at / last_modified
  • BigQuery-maintained _PARTITIONTIME / _PARTITIONDATE on partitioned tables
  • INFORMATION_SCHEMA.PARTITIONS.last_modified_time for partition-level freshness

Example incremental read with watermark filter:

query = f"""
SELECT *
FROM `{project}.{dataset}.{table}`
WHERE updated_at > TIMESTAMP('{last_watermark}')
"""

See incremental-loading.md for watermark storage.

Partition Decorators

For time-partitioned BigQuery tables, use partition decorators to target specific partitions and reduce bytes scanned:

# Read only 2026-04 partitions
query = f"""
SELECT *
FROM `{project}.{dataset}.{table}`
WHERE _PARTITIONTIME BETWEEN TIMESTAMP('2026-04-01') AND TIMESTAMP('2026-04-30')
"""

Clustered tables benefit similarly from filter push-down on clustering columns. Check clustering:

SELECT clustering_fields FROM `<project>.<dataset>.INFORMATION_SCHEMA.TABLES` WHERE table_name = '<table>';

Type Mapping

BigQuery Iceberg Notes
STRING STRING
INT64, INTEGER BIGINT All BQ integers are 64-bit
NUMERIC DECIMAL(38,9) BQ NUMERIC is fixed precision
BIGNUMERIC STRING Iceberg DECIMAL caps at (38,38); store as STRING, cast on read
FLOAT64, FLOAT DOUBLE
BOOL, BOOLEAN BOOLEAN
BYTES BINARY
DATE DATE
TIME STRING Iceberg has no TIME type
DATETIME TIMESTAMP No timezone
TIMESTAMP TIMESTAMPTZ UTC-anchored
GEOGRAPHY STRING WKT or GeoJSON
STRUCT STRUCT
ARRAY ARRAY
JSON STRING Parse if needed

BIGNUMERIC (up to 76.38 precision) exceeds Iceberg DECIMAL's 38-digit cap. For full-precision needs, store as STRING and cast on read.

Further Reading

Source: SKILL.md on GitHub

2 warnings17d3 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    This skill facilitates the ingestion of data from various external sources into an AWS data lake. It contains security considerations related to the processing of untrusted data and the dynamic generation of Spark scripts, which are characteristic of ETL (Extract, Transform, Load) operations. These patterns are consistent with the skill's purpose and are used within a managed cloud environment.

  • Socket17d

    1 alert: gptAnomaly

  • Snyk17d

    Risk: MEDIUM · 1 issue

Signed by skilld at b33847d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
Other metadata
metadata
{
  "version": "1",
  "argument-hint": "'[source-path|connection-name|table-name] [--target s3-tables|iceberg|parquet]'"
}

README badge

README badge for aws/agent-toolkit-for-aws/ingesting-into-data-lake