ExprNodeDesc desc = op.getConf().getPredicate();
return validateExprNodeDesc(desc, VectorExpressionDescriptor.Mode.FILTER);
}
private boolean validateGroupByOperator(GroupByOperator op, boolean isReduce, boolean isTez) {
GroupByDesc desc = op.getConf();
VectorGroupByDesc vectorDesc = desc.getVectorDesc();
if (desc.isGroupingSetsPresent()) {
LOG.info("Grouping sets not supported in vector mode");
return false;
}
boolean ret = validateExprNodeDesc(desc.getKeys());
if (!ret) {
return false;
}
ret = validateAggregationDesc(desc.getAggregators(), isReduce);
if (!ret) {
return false;
}
if (isReduce) {
if (desc.isDistinct()) {
LOG.info("Distinct not supported in reduce vector mode");
return false;
}
// Sort-based GroupBy?
if (desc.getMode() != GroupByDesc.Mode.COMPLETE &&
desc.getMode() != GroupByDesc.Mode.PARTIAL1 &&
desc.getMode() != GroupByDesc.Mode.PARTIAL2 &&
desc.getMode() != GroupByDesc.Mode.MERGEPARTIAL) {
LOG.info("Reduce vector mode not supported when input for GROUP BY not sorted");
return false;
}
LOG.info("Reduce GROUP BY mode is " + desc.getMode().name());
if (desc.getGroupKeyNotReductionKey()) {
LOG.info("Reduce vector mode not supported when group key is not reduction key");
return false;
}
if (!aggregatorsOutputIsPrimitive(desc.getAggregators(), isReduce)) {
LOG.info("Reduce vector mode only supported when aggregate outputs are primitive types");
return false;
}
if (desc.getKeys().size() > 0) {
if (op.getParentOperators().size() > 0) {
LOG.info("Reduce vector mode can only handle a key group GROUP BY operator when it is fed by reduce-shuffle");
return false;
}
LOG.info("Reduce-side GROUP BY will process key groups");