use of com.dangdang.ddframe.rdb.sharding.parser.result.merger.OrderByColumn in project sharding-jdbc by dangdangdotcom.
the class ResultSetMergeContextTest method assertIsNeedMemorySortForGroupByWithGroupByAndOrderByDifferent.
@Test
public void assertIsNeedMemorySortForGroupByWithGroupByAndOrderByDifferent() throws SQLException {
MergeContext mergeContext = new MergeContext();
mergeContext.getOrderByColumns().add(new OrderByColumn("order_col", OrderByColumn.OrderByType.ASC));
mergeContext.getGroupByColumns().add(new GroupByColumn(Optional.<String>absent(), "group_col", Optional.<String>absent(), OrderByColumn.OrderByType.ASC));
ResultSetMergeContext actual = new ResultSetMergeContext(new ShardingResultSets(Collections.singletonList(MergerTestUtil.mockResult(Arrays.asList("order_col", "group_col")))), mergeContext);
assertTrue(actual.isNeedMemorySortForGroupBy());
}
Aggregations