adding getQuery method to partition