bug fix: no need sort if NaryJoin will turn to hash join.