used sourceRelation instead of table attribute in planner

use ``querySpec.sourceRelation() instance of TableInfo`` see http://stackoverflow.com/questions/8692214/when-to-use-class-isinstance-when-to-use-instanceof-operator