[SPARK-3252] Add missing condition for test


According to the text message, both relations should be tested. So add the missing condition.