private void checkSelection(OutputAttribute newAttribute) {

        for (OutputAttribute attribute : selectionList) {
            if (attribute.getRename().equals(newAttribute.getRename())) {
                throw new DuplicateAttributeException(newAttribute.getRename() + " is already defined as an output " +
                        "attribute ", newAttribute.getQueryContextStartIndex(), attribute.getQueryContextEndIndex());
            }
        }
    }
Selector selecting query output stream attributes
modules/siddhi-query-api/src/main/java/io/siddhi/query/api/execution/query/selection/Selector.java