public String getRewriteFieldName() { if (isCount()) { return "_KY_" + "COUNT__"; // ignores parameter, count(*), count(1), count(col) are all the same } else if (isCountDistinct()) { return "_KY_" + getFullExpressionInAlphabetOrder().replaceAll("[(),. ]", "_"); } else { return "_KY_" + getFullExpression().replaceAll("[(),. ]", "_"); } }
MeasureDesc im = icMeasures.get(i); assertEquals(lm.getName(), im.getName()); assertEquals(lm.getFunction().getFullExpression(), im.getFunction().getFullExpression()); assertEquals(lm.getFunction().getReturnType(), im.getFunction().getReturnType());
public String getRewriteFieldName() { if (isSum()) { return getParameter().getValue(); } else if (isCount()) { return "COUNT__"; // ignores parameter, count(*), count(1), // count(col) are all the same } else { return getFullExpression().replaceAll("[(), ]", "_"); } }
public String getRewriteFieldName() { if (isCount()) { return "_KY_" + "COUNT__"; // ignores parameter, count(*), count(1), count(col) are all the same } else if (isCountDistinct()) { return "_KY_" + getFullExpressionInAlphabetOrder().replaceAll("[(),. ]", "_"); } else { return "_KY_" + getFullExpression().replaceAll("[(),. ]", "_"); } }
private List<RowValueDecoder> translateAggregation(HBaseMappingDesc hbaseMapping, Collection<FunctionDesc> metrics, // StorageContext context) { Map<HBaseColumnDesc, RowValueDecoder> codecMap = Maps.newHashMap(); for (FunctionDesc aggrFunc : metrics) { Collection<HBaseColumnDesc> hbCols = hbaseMapping.findHBaseColumnByFunction(aggrFunc); if (hbCols.isEmpty()) { throw new IllegalStateException("can't find HBaseColumnDesc for function " + aggrFunc.getFullExpression()); } HBaseColumnDesc bestHBCol = null; int bestIndex = -1; for (HBaseColumnDesc hbCol : hbCols) { bestHBCol = hbCol; bestIndex = hbCol.findMeasureIndex(aggrFunc); MeasureDesc measure = hbCol.getMeasures()[bestIndex]; // criteria for holistic measure: Exact Aggregation && Exact Cuboid if (measure.isHolisticCountDistinct() && context.isExactAggregation()) { logger.info("Holistic count distinct chosen for " + aggrFunc); break; } } RowValueDecoder codec = codecMap.get(bestHBCol); if (codec == null) { codec = new RowValueDecoder(bestHBCol); codecMap.put(bestHBCol, codec); } codec.setIndex(bestIndex); } return new ArrayList<RowValueDecoder>(codecMap.values()); }
public String getRewriteFieldName() { if (isSum()) { return getParameter().getValue(); } else if (isCount()) { return "COUNT__"; // ignores parameter, count(*), count(1), // count(col) are all the same } else { return getFullExpression().replaceAll("[(), ]", "_"); } }