prevent sql data use case where group_by is none but keys is not empty