add getter for query in queryresultwriter