Skip to content

Commit

Permalink
v1Table.v1Table.qualifiedName -> catalog.name +: ident.namespace :+ i…
Browse files Browse the repository at this point in the history
…dent.name
  • Loading branch information
wangyum committed Jan 3, 2020
1 parent 99a8557 commit 8e7b666
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ object FakeV2SessionCatalog extends TableCatalog {
case class AnalysisContext(
catalogAndNamespace: Seq[String] = Nil,
nestedViewDepth: Int = 0,
relationCache: mutable.Map[String, LogicalPlan] = mutable.Map.empty)
relationCache: mutable.Map[Seq[String], LogicalPlan] = mutable.Map.empty)

object AnalysisContext {
private val value = new ThreadLocal[AnalysisContext]() {
Expand Down Expand Up @@ -874,8 +874,9 @@ class Analyzer(
case SessionCatalogAndIdentifier(catalog, ident) =>
CatalogV2Util.loadTable(catalog, ident).map {
case v1Table: V1Table =>
val key = catalog.name +: ident.namespace :+ ident.name
AnalysisContext.get.relationCache.getOrElseUpdate(
v1Table.v1Table.qualifiedName, v1SessionCatalog.getRelation(v1Table.v1Table))
key, v1SessionCatalog.getRelation(v1Table.v1Table))
case table =>
DataSourceV2Relation.create(table)
}
Expand Down

0 comments on commit 8e7b666

Please sign in to comment.