Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Mage ai Mage ai Batch Export

From Leeroopedia


Knowledge Sources
Domains Data_Integration, ETL, Batch_Processing
Last Updated 2026-02-09 00:00 GMT

Overview

An abstract batch export mechanism that provides the extension point for destination connectors to write accumulated records to their target storage system.

Description

Batch Export is the core abstraction for destination data loading. After records are validated and accumulated by the ingestion loop, they are passed as a batch to the export layer. The Mage framework defines this as an abstract method that each destination connector must implement with target-specific logic: INSERT/UPDATE/UPSERT operations for databases, API calls for cloud services, or file writes for storage targets. Error handling is per-stream, allowing successful streams to commit even if others fail.

Usage

Every destination connector must implement the batch export interface. This is where the actual data loading logic lives: SQL INSERT statements, API POST requests, file writes, etc.

Theoretical Basis

The batch export contract:

  1. Receives a list of validated record dicts with schema and stream metadata
  2. Writes records to the target system using connector-specific logic
  3. Handles errors per-stream to allow partial success across multiple streams
  4. May perform deduplication based on key_properties
  5. May use unique_conflict_method (UPDATE) for upsert behavior

The framework calls export_batch_data via process_record_data, which wraps it with logging and error handling.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment