Operator definitions
A stream operator can be invoked to transform input streams to output streams. SPL supports two kinds of operators: primitive operators and composite operators.
A primitive operator is written in C++ or Java™, whereas a composite operator is written in SPL and contains a reusable stream subgraph. An application can be viewed as a hierarchy of operator invocations, where the leaves are primitive operators, each level groups graphs of operators into composite operators, and the root is a main operator to be deployed as an application instance on the streaming middleware. All operator invocations follow the syntax that is described in Operator invocations irrespective of whether they invoke primitive or composite operators.
New operators can be defined, which then can be invoked to define streams. Most streaming languages are tailored towards a single application domain. For example, StreamSQL targets the stream-relational domain. SPL, however, is designed to address a diverse set of domains. Key to this diversity is that SPL users can define their own operators, either in SPL or by reusing legacy code that is written in C++ or Java™.