1. A non-transitory computer-readable storage medium storing thereon computer-readable instructions that, when executed by a processor, cause the processor to execute instructions, comprising: instructions for performing optimization on an operator tree in accordance with a set of optimization rules; instructions for restructuring the operator tree in accordance with each of two or more different data sources such that a different segment of the operator tree is associated with each of the two or more different data sources; instructions for obtaining an operator mapping associated with one of the two or more different data sources; instructions for determining from the operator mapping whether an operator in the operator tree is supported by the one of the two or more different data sources; and instructions for instructing the one of the two or more data sources to execute the operator when it is determined from the operator mapping that the operator is supported by the one of the two or more data sources.