query_to_hash