OutputTransformer

Passo a passo de como iniciar sua jornada na Dadosfera

OutputTransformer

Overview

Transforms Tableau Output nodes to SQL SELECT passthrough statements. Output nodes mark the end of a Tableau Prep flow and pass all data from the previous stage.

Node Type: .v1.Output Output: SQL SELECT passthrough

Important Note

OUTPUT nodes do NOT generate INSERT/UPDATE/DELETE SQL. The converter only handles data transformation (SELECT statements). Actual data loading to target tables must be configured separately in Snowflake.

Capabilities

  • Passthrough all columns from previous stage (SELECT *)
  • Preserves input schema exactly
  • Documents target output metadata
  • Marks end of transformation flow

Tableau Node Example

Input (Tableau format)

{
  "id": "91e00f38-b829-448a-8d3b-ae43517d4da7",
  "name": "Output Sales Data",
  "node_type": ".v1.Output",
  "base_type": "output",
  "fields": [
    {
      "name": "region_code",
      "type": "string",
      "ordinal": 0
    },
    {
      "name": "sales_amount",
      "type": "real",
      "ordinal": 1
    },
    {
      "name": "order_date",
      "type": "date",
      "ordinal": 2
    },
    {
      "name": "customer_id",
      "type": "integer",
      "ordinal": 3
    }
  ],
  "actions": []
}

Generated SQL Output

SELECT
  *
FROM previous_stage_V0S15

Output Schema

{
  "region_code": "string",
  "sales_amount": "real",
  "order_date": "date",
  "customer_id": "integer"
}

How It Works

1. Identify Output Node

Recognizes Tableau Output nodes:

{
  "node_type": ".v1.Output",
  "base_type": "output"
}

2. Generate Passthrough SELECT

Creates SELECT * from upstream stage:

SELECT
  *
FROM previous_stage

3. Preserve Schema

Output schema matches input schema exactly (no transformations applied).

Output Node Configuration

Output nodes in Tableau Prep can specify target destinations:

File Output

{
  "outputConfig": {
    "type": "file",
    "path": "/data/output/sales_data.csv"
  }
}

Database Output

{
  "outputConfig": {
    "type": "database",
    "table": "PUBLIC.SALES_DATA"
  }
}

These configurations are documented as metadata but NOT converted to SQL. You must configure data loading separately in Snowflake.

Multiple Outputs

A Tableau Prep flow can have multiple output nodes:

Transform → Output 1 (CSV)
         → Output 2 (Database)
         → Output 3 (Tableau Extract)

Each output becomes a separate SELECT statement in the converted SQL.

Use Cases

Simple Passthrough

-- No transformations, just pass data through
SELECT * FROM final_transform_V0S20

Named Output

-- Output for specific purpose (documented in comments)
-- Target: PUBLIC.MONTHLY_SALES_REPORT
SELECT * FROM monthly_aggregates_V0S18

Limitations

  • ⚠️ No DML generation - INSERT/UPDATE/DELETE not generated by converter
  • ⚠️ No target table creation - Tables must exist in Snowflake before loading
  • ⚠️ No write operations - Output nodes only produce SELECT statements
  • ⚠️ Manual loading required - Use Snowflake COPY, INSERT INTO, or orchestration tools to load data

Loading Data to Target Tables

After conversion, you must configure data loading separately:

Option 1: CREATE TABLE AS SELECT (CTAS)

CREATE OR REPLACE TABLE PUBLIC.SALES_DATA AS
SELECT * FROM previous_stage_V0S15;

Option 2: INSERT INTO

INSERT INTO PUBLIC.SALES_DATA
SELECT * FROM previous_stage_V0S15;

Option 3: Snowflake COPY

-- Export to stage first, then COPY
COPY INTO PUBLIC.SALES_DATA
FROM @my_stage/output_data
FILE_FORMAT = (TYPE = 'CSV');

Option 4: Orchestration Tools

Use workflow orchestration (Airflow, Dagster, etc.) to:

  1. Execute the converted SQL query
  2. Capture results in a temp table
  3. Load temp table data to target table

Best Practices

When to Use Output Transformer

  • End of transformation pipeline - Mark final output point
  • Multiple output destinations - Create separate outputs for different consumers
  • Data handoff - Pass transformed data to downstream systems

Documenting Output Intent

Add comments to clarify output purpose:

-- Output: Monthly Sales Summary
-- Target: PUBLIC.MONTHLY_SALES_REPORT
-- Load Frequency: Daily at 6 AM
SELECT * FROM monthly_summary_V0S25;

Related Transformers

  • ContainerTransformer - For transformations before output
  • AggregateTransformer - For final aggregations before output
  • LoadExcelTransformer - Opposite operation (reads data in)
  • LoadSqlProxyTransformer - Opposite operation (reads from database)