private void makeConsistentOrThrow(SummaryField field1, SummaryField field2, Schema schema) {
        if (field1.getElementsSelector().equals(SummaryElementsSelector.selectAll()) &&
            field1.getTransform() == SummaryTransform.NONE &&
            field2.getTransform() == SummaryTransform.ATTRIBUTE) {
            Attribute attribute = schema.getAttribute(field1.getName());
            if (attribute != null) {
                field1.setElementsSelector(field2.getElementsSelector());
                field1.setTransform(SummaryTransform.ATTRIBUTE);
            }
        }

        if (field2.getElementsSelector().equals(SummaryElementsSelector.selectAll()) &&
            field2.getTransform().equals(SummaryTransform.NONE)) {
            field2.setElementsSelector(field1.getElementsSelector());
            field2.setTransform(field1.getTransform());
        }

        assertEqualElementsSelector(field1, field2);
        assertEqualTransform(field1,field2);
    }
Ensure that summary field transforms for fields having the same name
are consistent across summary classes

@author bratseth
config-model/src/main/java/com/yahoo/schema/processing/SummaryConsistency.java