private void enableStreamAggregateIfBeneficial(Cuboid cuboid, Set<TblColRef> groupsD, StorageContext context) { CubeDesc cubeDesc = cuboid.getCubeDesc(); boolean enabled = cubeDesc.getConfig().isStreamAggregateEnabled(); Set<TblColRef> shardByInGroups = Sets.newHashSet(); for (TblColRef col : cubeDesc.getShardByColumns()) { if (groupsD.contains(col)) { shardByInGroups.add(col); } } if (!shardByInGroups.isEmpty()) { enabled = false; logger.debug("Aggregate partition results is not beneficial because shard by columns in groupD: {0}", shardByInGroups); } if (!context.isNeedStorageAggregation()) { enabled = false; logger.debug("Aggregate partition results is not beneficial because no storage aggregation"); } if (enabled) { context.enableStreamAggregate(); } }
private void enableStreamAggregateIfBeneficial(Cuboid cuboid, Set<TblColRef> groupsD, StorageContext context) { CubeDesc cubeDesc = cuboid.getCubeDesc(); boolean enabled = cubeDesc.getConfig().isStreamAggregateEnabled(); Set<TblColRef> shardByInGroups = Sets.newHashSet(); for (TblColRef col : cubeDesc.getShardByColumns()) { if (groupsD.contains(col)) { shardByInGroups.add(col); } } if (!shardByInGroups.isEmpty()) { enabled = false; logger.debug("Aggregate partition results is not beneficial because shard by columns in groupD: {0}", shardByInGroups); } if (!context.isNeedStorageAggregation()) { enabled = false; logger.debug("Aggregate partition results is not beneficial because no storage aggregation"); } if (enabled) { context.enableStreamAggregate(); } }