modified QueryPartitioner