Search in sources :

Example 11 with ItemSum

use of com.actiontech.dble.plan.common.item.function.sumfunc.ItemSum in project dble by actiontech.

the class GroupByLocalResult method onFoundRow.

protected void onFoundRow(RowDataPacket oldRow, RowDataPacket row) {
    // we need to calculate group by
    initSumFunctions(this.sums, oldRow);
    updateSumFunc(this.sums, row);
    for (int i = 0; i < this.sums.size(); i++) {
        ItemSum sum = this.sums.get(i);
        Object b = sum.getTransAggObj();
        int transSize = sum.getTransSize();
        ((DGRowPacket) oldRow).setSumTran(i, b, transSize);
    }
}
Also used : ItemSum(com.actiontech.dble.plan.common.item.function.sumfunc.ItemSum) DGRowPacket(com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.DGRowPacket)

Example 12 with ItemSum

use of com.actiontech.dble.plan.common.item.function.sumfunc.ItemSum in project dble by actiontech.

the class GroupByLocalResult method initSumFunctions.

protected void initSumFunctions(List<ItemSum> functions, RowDataPacket row) {
    for (int i = 0; i < functions.size(); i++) {
        ItemSum sum = functions.get(i);
        Object transObj = ((DGRowPacket) row).getSumTran(i);
        sum.resetAndAdd(row, transObj);
    }
}
Also used : ItemSum(com.actiontech.dble.plan.common.item.function.sumfunc.ItemSum) DGRowPacket(com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.DGRowPacket)

Example 13 with ItemSum

use of com.actiontech.dble.plan.common.item.function.sumfunc.ItemSum in project dble by actiontech.

the class GroupByLocalResult method updateSumFunc.

protected void updateSumFunc(List<ItemSum> functions, RowDataPacket row) {
    for (int index = 0; index < functions.size(); index++) {
        ItemSum sum = functions.get(index);
        Object transObj = ((DGRowPacket) row).getSumTran(index);
        sum.aggregatorAdd(row, transObj);
    }
}
Also used : ItemSum(com.actiontech.dble.plan.common.item.function.sumfunc.ItemSum) DGRowPacket(com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.DGRowPacket)

Example 14 with ItemSum

use of com.actiontech.dble.plan.common.item.function.sumfunc.ItemSum in project dble by actiontech.

the class GroupResultDiskBuffer method updateSumFunc.

protected void updateSumFunc(List<ItemSum> functions, RowDataPacket row) {
    for (int index = 0; index < functions.size(); index++) {
        ItemSum sum = functions.get(index);
        Object transObj = ((DGRowPacket) row).getSumTran(index);
        sum.aggregatorAdd(row, transObj);
    }
}
Also used : ItemSum(com.actiontech.dble.plan.common.item.function.sumfunc.ItemSum) DGRowPacket(com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.DGRowPacket)

Example 15 with ItemSum

use of com.actiontech.dble.plan.common.item.function.sumfunc.ItemSum in project dble by actiontech.

the class GroupResultDiskBuffer method initSumFunctions.

protected void initSumFunctions(List<ItemSum> functions, RowDataPacket row) {
    for (int i = 0; i < functions.size(); i++) {
        ItemSum sum = functions.get(i);
        Object transObj = ((DGRowPacket) row).getSumTran(i);
        sum.resetAndAdd(row, transObj);
    }
}
Also used : ItemSum(com.actiontech.dble.plan.common.item.function.sumfunc.ItemSum) DGRowPacket(com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.DGRowPacket)

Aggregations

ItemSum (com.actiontech.dble.plan.common.item.function.sumfunc.ItemSum)23 DGRowPacket (com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.DGRowPacket)8 Item (com.actiontech.dble.plan.common.item.Item)6 RowDataPacket (com.actiontech.dble.net.mysql.RowDataPacket)5 ArrayList (java.util.ArrayList)4 RowDataComparator (com.actiontech.dble.backend.mysql.nio.handler.util.RowDataComparator)3 Field (com.actiontech.dble.plan.common.field.Field)3 FieldPacket (com.actiontech.dble.net.mysql.FieldPacket)2 Order (com.actiontech.dble.plan.Order)2 ItemFunc (com.actiontech.dble.plan.common.item.function.ItemFunc)2 DirectGroupByHandler (com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.DirectGroupByHandler)1 OrderedGroupByHandler (com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.OrderedGroupByHandler)1 GroupByBucket (com.actiontech.dble.backend.mysql.nio.handler.query.impl.groupby.directgroupby.GroupByBucket)1 DistinctLocalResult (com.actiontech.dble.backend.mysql.store.DistinctLocalResult)1 GroupByLocalResult (com.actiontech.dble.backend.mysql.store.GroupByLocalResult)1 ResultStore (com.actiontech.dble.plan.common.external.ResultStore)1 ItemField (com.actiontech.dble.plan.common.item.ItemField)1 ItemInt (com.actiontech.dble.plan.common.item.ItemInt)1 ItemScalarSubQuery (com.actiontech.dble.plan.common.item.subquery.ItemScalarSubQuery)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1