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()); } } }
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()); } } }
private static List<StreamColumn> convertOutputStreamColumns(List<OutputAttribute> outputAttributeList) { return outputAttributeList.stream().map(outputAttribute -> { StreamColumn streamColumn = new StreamColumn(); streamColumn.setName(outputAttribute.getRename()); streamColumn.setDescription(outputAttribute.getExpression().toString()); return streamColumn; }).collect(Collectors.toList()); } }
List<OutputAttribute> list = query.getSelector().getSelectionList(); for (OutputAttribute output : list) { outputFields.add(output.getRename());
/** * Generates a SelectedAttribute object from the given Siddhi OutputAttribute * @param outputAttribute Siddhi OutputAttribute object * @return SelectedAttribute object * @throws DesignGenerationException Error while getting the definition of the OutputAttribute */ private SelectedAttribute generateSelectedAttribute(OutputAttribute outputAttribute) throws DesignGenerationException { SelectedAttribute selectedAttribute = new SelectedAttribute( ConfigBuildingUtilities.getDefinition(outputAttribute.getExpression(), siddhiAppString), outputAttribute.getRename()); preserveAndBindCodeSegment(outputAttribute, selectedAttribute); return selectedAttribute; } }