REDUCER
inputValue(input 위치에서 찾은 데이터)의 row count 만큼 roof 돌며 각 아이템에 대하여 Reducer Terms 처리 후 output에 반환
Define field
Reducer
ID | Description |
---|---|
id | reducer flow component id |
name | 이름 |
input | flow Component 처리 기준 데이터 위치 |
output | flow Component 처리 결과 위치 |
next | 다음 flow Component id |
Reducer Terms
ID | Description |
---|---|
id | reducer terms id |
field | 집계된 결과 값의 Key 선언
|
method | 집계함수
(아래 상세설명) |
value | 집계할 값의 위치
|
Reducer Terms Method ( Aggregate Functions )
aggregate function calculates and returns a single result for Array
ID | Description |
---|---|
Sum | returns the sum of values in a set of values |
Avg | returns the average of values of a set |
Count | returns the number of values in a set or number of rows |
Min | returns the minimum value in a set of values |
Max | returns the maximum value in a set of values |
Method | Method can be customized |
reducer start
next |
SAMPLE
{
"typeId": "reducer",
"id": 100122,
"name": "TotalSalePrice by group",
"input": "groups.list",
"output": "groups.price",
"reducerTerms": [
{ "id": null, "field": "totalSalePrice", "method": "sum", "value": "price.salePrice" },
{ "id": null, "field": "totalQuantity", "method": "sum", "value": "quantity" },
{ "id": null, "field": "totalDiscountSalePrice", "method": "sum", "value": "price.immediateDiscountSalePrice" },
{ "id": null, "field": "totalDiscountPrice", "method": "sum", "value": "price.immediateDiscountPrice" }
],
"next": 100028
}
RESULT
{
"result": "200",
"resultMessage": "SUCCESS",
"items": [
{
"siteProduct.productDeliveryInfo.deliveryType": "normal",
"seller.id": "",
"siteProduct.productDeliveryInfo.deliveryBundleGroup.id": 101,
"siteProduct.productDeliveryInfo.productDeliveryFee.deliveryFeeType": "conditional",
"price": {
"totalQuantity": 2,
"totalSalePrice": 279000,
"totalDiscountSalePrice": 279000,
"totalDiscountPrice": 0
}
},
{
"siteProduct.productDeliveryInfo.deliveryType": "normal",
"seller.id": "",
"siteProduct.productDeliveryInfo.deliveryBundleGroup.id": 102,
"siteProduct.productDeliveryInfo.productDeliveryFee.deliveryFeeType": "conditional",
"price": {
"totalQuantity": 2,
"totalSalePrice": 264000,
"totalDiscountSalePrice": 264000,
"totalDiscountPrice": 0
}
}
]
}