Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

duckdb-transformation

БесплатноБез исполняемых скриптовНе проверен

Expert knowledge for writing, optimizing, and migrating DuckDB transformations in Keboola. Covers SQL dialect, block orchestration, dynamic backends, Parquet…

keboolaот keboola★ 17 звёзд на GitHub

Об этом скилле

DuckDB Transformation Knowledge

Provide expertise on writing, configuring, and optimizing DuckDB transformations in Keboola Connection.

Overview

DuckDB (keboola.duckdb-transformation) is an in-process analytical database (OLAP) with columnar storage, designed for fast SQL analytics. It is a cost-effective alternative to Snowflake for small-to-medium datasets.

Status: BETA --- breaking changes may occur.

Key advantages:

  • In-process execution (no external database server)
  • Columnar storage optimized for analytical queries
  • Block-based orchestration with automatic dependency analysis
  • Parallel execution of independent scripts
  • Rich SQL dialect with modern quality-of-life extensions

Configuration

Component ID

keboola.duckdb-transformation

Configuration Structure

{
  "parameters": {
    "blocks": [
      {
        "name": "Block Name",
        "codes": [
          {
            "name": "Script Name",
            "script": [
              "CREATE TABLE \"output\" AS",
              "SELECT * FROM \"input_table\";"
            ]
          }
        ]
      }
    ],
    "threads": 4,
    "max_memory_mb": 2048,
    "image_tag": "parquet",
    "dtypes_infer": false
  },
  "storage": {
    "input": {
      "tables": [
        {
          "source": "in.c-bucket.table",
          "destination": "input_table"
        }
      ]
    },
    "output": {
      "tables": [
        {
          "source": "output",
          "destination": "out.c-bucket.result"
        }
      ]
    }
  }
}

Settings

  • Timeout --- maximum execution time (default: 1 hour)
  • Backend size --- memory allocation (see Dynamic Backends)
  • DuckDB version --- latest (default) or pinned (e.g., 1.5.2, 1.4.4)
  • Automatic data types --- auto-assign types to output tables
  • Use parquet for input tables --- Parquet instead of CSV (recommended for >1 GB)
  • Infer input table data types --- infer types from input tables (useful for non-typed Storage)
  • Debug mode --- enable debug logging

Block-Based Orchestration

  • Blocks execute sequentially (one after another)
  • Scripts within a block execute in parallel (when no dependencies)
  • Uses SQLGlot for automatic SQL analysis
  • Builds a DAG (Directed Acyclic Graph) of dependencies
  • Execution order is automatically optimized

Dynamic Backends

Backend Size Memory Recommended For
XSmall 8 GB Small datasets, testing
Small (default) 16 GB Most use cases
Medium 32 GB Large datasets (5 GB+)
Large 113.6 GB Very large datasets (10 GB+)

Start with Small, scale up as needed. Dynamic backends are not available on Free/Pay As You Go plans.

DuckDB automatically detects available CPU and memory. Manual override via threads and max_memory_mb parameters.

Parquet Format

Enable Parquet for significantly better performance with large datasets:

  • Faster processing than CSV
  • Lower memory usage
  • Columnar storage optimized for analytics

Recommendation: Always use Parquet for datasets > 1 GB.

Configuration: set "image_tag": "parquet" or toggle Use parquet for input tables in UI.

Infer Input Table Data Types

Keboola Storage tables can be non-typed (all columns as VARCHAR). When enabled, DuckDB infers actual types (INTEGER, FLOAT, DATE, etc.) so aggregate functions and type-specific operations work without manual casting.

Without inference: SUM("amount") fails because amount is VARCHAR. With inference: SUM("amount") works because DuckDB detects it as numeric.

Sync Actions

Four debugging actions available without running the full transformation:

  1. syntax_check --- validate SQL syntax without execution
  2. lineage_visualization --- markdown diagram of data dependencies
  3. execution_plan_visualization --- planned execution order with blocks and batches
  4. expected_input_tables --- list of expected input tables based on SQL analysis

SQL Writing Rules

Semicolons Between Statements

Each SQL statement MUST be terminated with a semicolon (;). Multiple statements in a single script must be properly separated:

-- Correct: each statement ends with a semicolon
CREATE TABLE "output_a" AS SELECT * FROM "input_a";

CREATE TABLE "output_b" AS SELECT * FROM "input_b";

Missing semicolons cause syntax errors.

Case Sensitivity (CRITICAL)

Table names:

  • Unquoted → lowercase (MyTable → mytable)
  • Quoted → case-sensitive ("MyTable" stays MyTable)

Column names:

  • Always case-sensitive regardless of quoting
  • SELECT columnName and SELECT ColumnName refer to different columns

This is different from Snowflake (unquoted → uppercase, quoted columns case-insensitive).

Best practice: Use consistent lowercase naming or always quote identifiers.

Type Casting Patterns

For non-typed Storag

Полный SKILL.md на GitHub

Установить duckdb-transformation в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл duckdb-transformation?

Expert knowledge for writing, optimizing, and migrating DuckDB transformations in Keboola. Covers SQL dialect, block orchestration, dynamic backends, Parquet format, case sensitivity, Snowflake-to-DuckDB migration, type casting patterns, and best practices. Use when the user is writing DuckDB SQL, migrating from Snowflake, debugging DuckDB transformations, or needs guidance on DuckDB-specific syntax and configuration in Keboola.

Как установить скилл duckdb-transformation?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл duckdb-transformation запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить duckdb-transformation с