From c7644e9e0d6fc44781c342865c0aba63a94dffb8 Mon Sep 17 00:00:00 2001 From: spicy-sauce Date: Wed, 13 Mar 2024 10:06:37 +0200 Subject: [PATCH] fixed examples --- examples/test_csv_producer.dy.yaml | 48 +++++++++++++++------------- examples/test_redis_producer.dy.yaml | 48 +++++++++++++++------------- 2 files changed, 50 insertions(+), 46 deletions(-) diff --git a/examples/test_csv_producer.dy.yaml b/examples/test_csv_producer.dy.yaml index 5c489329..05de6932 100644 --- a/examples/test_csv_producer.dy.yaml +++ b/examples/test_csv_producer.dy.yaml @@ -1,25 +1,27 @@ -- uses: files.read_csv +input: + uses: files.read_csv with: file: examples/test.csv -- uses: add_field - with: - fields: - - field: full_name - language: jmespath - expression: concat([fname, ' ' , lname]) -- uses: map - with: - expression: - { - first_name: fname, - last_name: lname, - country: country_code || ' - ' || UPPER(country_name), - full_name: full_name, - greeting: "'Hello ' || CASE WHEN gender = 'F' THEN 'Ms.' WHEN gender = 'M' THEN 'Mr.' ELSE 'N/A' END || ' ' || full_name" - } - language: sql -- uses: relational.write - with: - connection: hr - schema: hr - table: emp +steps: + - uses: add_field + with: + fields: + - field: full_name + language: jmespath + expression: concat([fname, ' ' , lname]) + - uses: map + with: + expression: + { + first_name: fname, + last_name: lname, + country: country_code || ' - ' || UPPER(country_name), + full_name: full_name, + greeting: "'Hello ' || CASE WHEN gender = 'F' THEN 'Ms.' WHEN gender = 'M' THEN 'Mr.' ELSE 'N/A' END || ' ' || full_name" + } + language: sql + - uses: relational.write + with: + connection: hr + schema: hr + table: emp diff --git a/examples/test_redis_producer.dy.yaml b/examples/test_redis_producer.dy.yaml index eea0ac60..f7a3a517 100644 --- a/examples/test_redis_producer.dy.yaml +++ b/examples/test_redis_producer.dy.yaml @@ -1,26 +1,28 @@ -- uses: redis.read_stream +input: + uses: redis.read_stream with: connection: cache stream_name: emp -- uses: add_field - with: - fields: - - field: full_name - language: jmespath - expression: concat([fname, ' ' , lname]) -- uses: map - with: - expression: - { - first_name: fname, - last_name: lname, - country: country_code || ' - ' || UPPER(country_name), - full_name: full_name, - greeting: "'Hello ' || CASE WHEN gender = 'F' THEN 'Ms.' WHEN gender = 'M' THEN 'Mr.' ELSE 'N/A' END || ' ' || full_name" - } - language: sql -- uses: relational.write - with: - connection: hr - schema: hr - table: emp +steps: + - uses: add_field + with: + fields: + - field: full_name + language: jmespath + expression: concat([fname, ' ' , lname]) + - uses: map + with: + expression: + { + first_name: fname, + last_name: lname, + country: country_code || ' - ' || UPPER(country_name), + full_name: full_name, + greeting: "'Hello ' || CASE WHEN gender = 'F' THEN 'Ms.' WHEN gender = 'M' THEN 'Mr.' ELSE 'N/A' END || ' ' || full_name" + } + language: sql + - uses: relational.write + with: + connection: hr + schema: hr + table: emp