Skip to content

Commit c1ed29d

Browse files
committed
Fix bug.
1 parent e0f919b commit c1ed29d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,12 @@ private[hive] class HiveMetastoreCatalog(hive: HiveContext) extends Catalog with
450450
// Replaces all `MetastoreRelation`s with corresponding `ParquetRelation2`s, and fixes
451451
// attribute IDs referenced in other nodes.
452452
plan.transformUp {
453-
case r: MetastoreRelation => {
453+
case r: MetastoreRelation if relationMap.contains(r) => {
454454
val parquetRelation = relationMap(r)
455455
val withAlias =
456456
r.alias.map(a => Subquery(a, parquetRelation)).getOrElse(
457457
Subquery(r.tableName, parquetRelation))
458-
458+
459459
withAlias
460460
}
461461
case other => other.transformExpressions {

0 commit comments

Comments
 (0)