Column rename transform

Overview

column-rename registers a table transform used by another factory. It changes a queryable view's names and types, not stored source data.

Example configuration

rules:                         # Required: ordered rules; first match wins.
  - type: direct               # Select the direct-name variant.
    from: temperature          # Required: example source column.
    to: temperature_c          # Required: example output column.
    cast: null                 # Default: preserve the source type.
  - type: pattern              # Alternative rule variant; no cast option.
    pattern: "^sensor_(.*)$"   # Required: example regular expression.
    replacement: "$1"          # Required: captured name becomes the output name.

Use and behavior

Install the transform with pond mknod column-rename /etc/rename --config-path rename.yaml, then reference /etc/rename in a consuming factory's transforms list.

Rules apply first-match-wins. Direct rules can request a cast. Invalid types or regular expressions and conflicting output schemas fail. Inspect the consuming node's schema to observe the result.

Full configuration

Settings

FieldAccepted typeRequiredDefaultDescription
rulesarray of Rename Ruleyesnot specifiedList of rename rules applied in order

Rename Rule

A single column rename rule

Choose one of the following:

Direct column name mapping

FieldAccepted typeRequiredDefaultDescription
caststring | nullnonot specified
fromstringyesnot specified
tostringyesnot specified
type"direct"yesnot specified

Regex pattern-based renaming

FieldAccepted typeRequiredDefaultDescription
patternstringyesnot specified
replacementstringyesnot specified
type"pattern"yesnot specified