map

Map a record into a new output based on expressions

Map a record into a new output based on expressions

Properties

Name Type Description Required
expression object, string Expression
yes
language string Language
Enum: "jmespath", "sql"
yes

Additional Properties: not allowed

Example

source:
  server_name: redislabs
  schema: dbo
  table: emp
transform:
  - uses: map
    with:
      expression:
        first_name: first_name
        last_name: last_name
        greeting: >-
          'Hello ' || CASE WHEN gender = 'F' THEN 'Ms.' WHEN gender = 'M' THEN 'Mr.'
          ELSE 'N/A' END || ' ' || full_name          
        country: country
        full_name: full_name
      language: sql

Example

source:
  table: customer
transform:
  - uses: map
    with:
      expression: |
        {
          "CustomerId": customer_id,
          "FirstName": first_name,
          "LastName": last_name,
          "Company": company,
          "Location":
          {
            "Street": address,
            "City": city,
            "State": state,
            "Country": country,
            "PostalCode": postal_code
          },
          "Phone": phone,
          "Fax": fax,
          "Email": email
        }        
      language: jmespath

expression: object

Expression

No properties.

RATE THIS PAGE
Back to top ↑