Update query_gen.R

conflict resolution