[SQL] SPARK-1354 Fix self-joins of parquet relations

@AndreSchumacher, please take a look.