Reshapeコネクタ
Reshapeコネクタは、フィールドの名前変更または静的値の追加によってペイロード構造を変更します。
コネクタタイプ: MeddleReshape
Field Renameモード
Section titled “Field Renameモード”ペイロードフィールドの名前を変更:
{ "type": "MeddleReshape", "config": { "mode": "FieldRename", "fieldNames": { "temp": "temperature", "press": "pressure", "hum": "humidity" } }}入力:
{"temp": 25.5, "press": 101.3, "hum": 60}出力:
{"temperature": 25.5, "pressure": 101.3, "humidity": 60}Static Enrichモード
Section titled “Static Enrichモード”ペイロードに静的フィールドを追加:
{ "type": "MeddleReshape", "config": { "mode": "StaticEnrich", "newFields": { "location": "Factory 1", "unit": "celsius", "version": "1.0" } }}入力:
{"temperature": 25.5}出力:
{ "temperature": 25.5, "location": "Factory 1", "unit": "celsius", "version": "1.0"}ユースケース
Section titled “ユースケース”- 異なるデータソース間でフィールド名を正規化
- メタデータを追加(場所、ソース、バージョン)
- 保存前にデータ形式を標準化
- 生のセンサーデータにコンテキストを追加
ベストプラクティス
Section titled “ベストプラクティス”- 命名規則を標準化するためにFieldRenameを使用
- パイプラインの早い段階でメタデータを追加
- 静的フィールドを意味のある関連性のあるものに保つ