used sourceRelation instead of table attribute in planner

use instanceof