1. A computer implemented method for conversion of units of measure during data stream processing, the method comprising: receiving one or more input streams to be processed by a query, wherein the query defines one or more expected input stream types for the one or more input streams; pre-processing the one or more input streams to match the one or more expected input stream types, wherein the pre-processing comprises: determining an input stream from the one or more input streams that is associated with a unit of measure that is different from an expected unit of measure defined for a corresponding expected input stream; determining a set of predefined mappings for converting the unit of measure, wherein a first mapping defines first formulas for conversion within a set of predefined units of measure associated with the unit of measure, and a second mapping defines second formulas for conversion within the set of predefined units of measure, wherein the first formulas are different from the second formulas; determining a mapping from the set which includes an optimal path for accomplishing the conversion, the optimal path defining a minimal number of consecutive formulas, defined within the mapping, wherein the minimal number of formulas is determined in comparison with a number of formulas associated with another path for the conversion defined within the set of predefined mappings; and based on the determined mapping and the optimal path, converting the unit of measure to the expected unit of measure; processing the pre-processed one or more input streams according to the query to generate a result output stream; post-processing the result output stream to match an expected output stream type defined by the query; and generating an output stream with the expected output stream type.