field.setAccessible(true); Query query = (Query) field.get(callback); List<OutputAttribute> list = query.getSelector().getSelectionList(); for (OutputAttribute output : list) { outputFields.add(output.getRename());
outputStreams.put(outputStream.getId(), selector.getSelectionList());
/** * Generates an AttributesSelectionConfig from the given Siddhi Selector * @param selector Siddhi Selector object * @return AttributesSelectionConfig object */ public AttributesSelectionConfig generateAttributesSelectionConfig(Selector selector) { List<SelectedAttribute> selectedAttributes = new ArrayList<>(); for (OutputAttribute outputAttribute : selector.getSelectionList()) { try { selectedAttributes.add(generateSelectedAttribute(outputAttribute)); } catch (DesignGenerationException e) { // Selector object has been successfully compiled by the Siddhi Compiler, but no query indexes // The OutputAttribute object was a result of 'select *' AllSelectionConfig allSelectionConfig = new AllSelectionConfig(); preserveAndBindCodeSegment(selector, allSelectionConfig); return new AllSelectionConfig(); } } UserDefinedSelectionConfig userDefinedSelectionConfig = new UserDefinedSelectionConfig(selectedAttributes); preserveAndBindCodeSegment(selector, userDefinedSelectionConfig); return new UserDefinedSelectionConfig(selectedAttributes); }
effectiveOutputStreams.put(outputStream.getId(), convertOutputStreamColumns(selector.getSelectionList())); } else { LOG.warn("Unhandled execution element: {}", executionElement.toString());
/** * Load all the elements of query */ private void loadQueryExecutionElements(SiddhiApp siddhiApp, SiddhiAppRuntime siddhiAppRuntime, ExecutionElement executionElement, String siddhiAppString, List<SiddhiAppElements> listOfSiddhiAppElements) { for (String inputStreamId : (((Query) executionElement).getInputStream() .getUniqueStreamIds())) { SiddhiAppElements siddhiAppElements = new SiddhiAppElements(); siddhiAppElements.setInputStreamId(inputStreamId); loadInputData(siddhiApp, siddhiAppRuntime, inputStreamId, siddhiAppString, siddhiAppElements); String outPutStreamId = ((Query) executionElement) .getOutputStream().getId(); siddhiAppElements.setOutputStreamId(outPutStreamId); loadOutputData(siddhiApp, siddhiAppRuntime, outPutStreamId, siddhiAppString, siddhiAppElements); loadFunctionData(siddhiApp, ((Query) executionElement).getSelector ().getSelectionList(), siddhiAppElements, siddhiAppString); loadQueryName(executionElement.getAnnotations(), siddhiAppElements); Query query = (Query) executionElement; siddhiAppElements.setQuery(getDefinition(query, siddhiAppString)); listOfSiddhiAppElements.add(siddhiAppElements); } }
String outputStreamId = query.getOutputStream().getId(); loadOutputData(siddhiApp, siddhiAppRuntime, outputStreamId, siddhiAppString, siddhiAppElements); loadFunctionData(siddhiApp, query.getSelector().getSelectionList(), siddhiAppElements, siddhiAppString);