/**
  * If flag to use walker not set manually we try to figure out if it will not brake query logic
  *
  * @param Query|SqlQuery $query
  *
  * @return bool
  */
 private function useWalker($query)
 {
     if ($query instanceof Query) {
         if (null === $this->shouldUseWalker) {
             return !$query->contains('GROUP BY') && null === $query->getMaxResults();
         }
         return $this->shouldUseWalker;
     }
     return false;
 }