[SPARK-3252][SQL] Add missing condition for test

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