impl query to map