OData Service Example
Find the example workflow below with two disconnected SQL Transformation stages. This example uses two tables, customers_dt and orders and returns them unmodified from [customers]/[orders]. The input file customers.txt is included in the RASON Examples Download file as explained within the section, Uploading Data from an External Data File within the chapter, Using the RASON Services Web IDE.
{
"workflow": "sqlWorkflow",
"customers": {
"comment": "transformation: SQL",
"datasources": {
"srcCustomers": {
"type": "csv",
"connection": "customers_dt.txt"
}
},
"datasets": {
"customers": {
"binding": "srcCustomers",
"colNames": [ "CustomerID", "Country", "Age" ],
"indexCols": ["CustomerID"]
}
},
"transformer": {
"mySQLTransformer": {
"type": "transformation",
"algorithm": "sql",
"parameters": {
"query": "SELECT * FROM [customers];"
}
}
},
"actions": {
"result": {
"action": "transform",
"evaluations": [ "transformation" ]
}
}
},
"orders": {
"comment": "transformation: SQL",
"datasources": {
"srcOrders": {
"type": "csv",
"connection": "orders.txt"
}
},
"datasets": {
"orders": {
"binding": "srcOrders",
"colNames": [ "OrderID", "CustomerID", "Price", "Quantity" ],
"indexCols": ["OrderID", "CustomerID"]
}
},
"transformer": {
"mySQLTransformer": {
"type": "transformation",
"algorithm": "sql",
"parameters": {
"query": "SELECT * FROM [orders];"
}
}
},
"actions": {
"result": {
"action": "transform",
"evaluations": [ "transformation" ]
}
}
}
}
|