implemented insert-by-query plan

isn't this check redundant, if orderBy is empty reverseFlags/nullsFirst would be null anyway?