ctripcorp / dal

Ctrip Database Access Layer
Apache License 2.0
1.24k stars 448 forks source link

数据分片 #10

Closed hiddenzzh closed 8 years ago

hiddenzzh commented 8 years ago

数据分片之后需要将结果聚合返回,这个是在客户端实现的功能么? 还有比如要进行AVG的操作,是否会智能化为:再各个分库执行COUNT和TOTAL,然后进行AVG=(n_TOTAL)/(n_COUNT)的结果返回?

lilongjiao commented 8 years ago

如果要取得数据分片之后的聚合返回,可以在hint里加入merge操作,例如DalHints hints = new DalHints().mergeBy(new ResultMerger. IntAverage()),

具体可以查看dal-client中com.ctrip.platform.dal.dao里的ResultMerger

姓名:李龙姣 部门:R&D 框架 DAL 座位号:18#6F109 地址:金钟路968号凌空SOHO

发件人: hiddenzzh [mailto:notifications@github.com] 发送时间: 2016年10月10日 10:42 收件人: ctripcorp/dal dal@noreply.github.com 主题: [ctripcorp/dal] 数据分片 (#10)

数据分片之后需要将结果聚合返回,这个是在客户端实现的功能么? 还有比如要进行AVG的操作,是否会智能化为:再各个分库执行COUNT和TOTAL,然后进行AVG=(nTOTAL)/(nCOUNT)的结果返回?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ctripcorp/dal/issues/10, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ATsoWviSKHzt-4VrjGWAYG2f4ed-OgHRks5qyaX6gaJpZM4KSMLR.

hiddenzzh commented 8 years ago

THX

hejiehui commented 8 years ago

如果没有进一步的问题,请close issue