Implementing the QueryCompiler