class MetadataResolver extends RelationMetadataProvider with DelegatesResolutionToExtensions
The MetadataResolver performs relation metadata resolution based on the unresolved plan at the start of the analysis phase. Usually it does RPC calls to some table catalog and to table metadata itself.
RelationsWithResolvedMetadata is a map from relation ID to the relations with resolved metadata. It's produced by resolve and is used later in Resolver to replace UnresolvedRelations.
This object is one-shot per SQL query or DataFrame program resolution.
- Alphabetic
- By Inheritance
- MetadataResolver
- DelegatesResolutionToExtensions
- RelationMetadataProvider
- LookupCatalog
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new MetadataResolver(catalogManager: CatalogManager, relationResolution: RelationResolution, extensions: Seq[ResolverExtension] = Seq.empty)
Type Members
- implicit class LogStringContext extends AnyRef
- Definition Classes
- Logging
- type RelationsWithResolvedMetadata = HashMap[RelationId, LogicalPlan]
- Definition Classes
- RelationMetadataProvider
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val catalogManager: CatalogManager
- Definition Classes
- MetadataResolver → LookupCatalog
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def currentCatalog: CatalogPlugin
Returns the current catalog set.
Returns the current catalog set.
- Definition Classes
- LookupCatalog
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- val extensions: Seq[ResolverExtension]
- Definition Classes
- MetadataResolver → DelegatesResolutionToExtensions
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def getRelationWithResolvedMetadata(unresolvedRelation: UnresolvedRelation): Option[LogicalPlan]
Get the LogicalPlan with resolved metadata for the given UnresolvedRelation.
Get the LogicalPlan with resolved metadata for the given UnresolvedRelation.
java.util.HashMap returns
nullif the key is not found, so we wrap it in an Option.- Definition Classes
- RelationMetadataProvider
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def initializeLogIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def log: Logger
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(entry: LogEntry, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(entry: LogEntry): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(entry: LogEntry, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(entry: LogEntry): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(entry: LogEntry, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(entry: LogEntry): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logName: String
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(entry: LogEntry, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(entry: LogEntry): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(entry: LogEntry, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(entry: LogEntry): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def relationIdFromUnresolvedRelation(unresolvedRelation: UnresolvedRelation): RelationId
Returns the RelationId for the given UnresolvedRelation.
Returns the RelationId for the given UnresolvedRelation. Here we use relationResolution to expand the UnresolvedRelation identifier fully, so that our RelationId uniquely identifies the unresolvedRelation.
This method is public, because it's used in MetadataResolverSuite.
- Definition Classes
- RelationMetadataProvider
- val relationResolution: RelationResolution
relationResolution is used by the RelationMetadataProvider to expand relation identifiers in relationIdFromUnresolvedRelation.
relationResolution is used by the RelationMetadataProvider to expand relation identifiers in relationIdFromUnresolvedRelation.
- Definition Classes
- MetadataResolver → RelationMetadataProvider
- val relationsWithResolvedMetadata: HashMap[RelationId, LogicalPlan]
relationsWithResolvedMetadata is a map from relation ID to the specific LogicalPlan with resolved metadata, like UnresolvedCatalogRelation or View.
relationsWithResolvedMetadata is a map from relation ID to the specific LogicalPlan with resolved metadata, like UnresolvedCatalogRelation or View. It's filled by the specific RelationMetadataProvider implementation and is queried in getRelationWithResolvedMetadata.
- Definition Classes
- MetadataResolver → RelationMetadataProvider
- def resolve(unresolvedPlan: LogicalPlan): Unit
Resolves the relation metadata for
unresolvedPlan.Resolves the relation metadata for
unresolvedPlan. Usually this involves several blocking calls for the UnresolvedRelations present in that tree. During theunresolvedPlantraversal we fill relationsWithResolvedMetadata with resolved metadata by relation id. This map will be used to resolve the plan in single-pass by the Resolver using getRelationWithResolvedMetadata. If the generic metadata resolution using RelationResolution wasn't successful, we resort to using extensions. Otherwise, we fail with an exception.- Definition Classes
- MetadataResolver → RelationMetadataProvider
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tryDelegateResolutionToExtension(unresolvedOperator: LogicalPlan, resolver: LogicalPlanResolver): Option[LogicalPlan]
Find the suitable extension for
unresolvedOperatorresolution and resolve it with that extension.Find the suitable extension for
unresolvedOperatorresolution and resolve it with that extension. Usually extensions return resolved relation nodes, so we generically update the name scope without matching for specific relations, for simplicity.We match the extension once to reduce the number of ResolverExtension.resolveOperator.isDefinedAt calls, because those can be expensive.
- returns
Some(resolutionResult)if the extension was found andunresolvedOperatorwas resolved,Noneotherwise.
- Attributes
- protected
- Definition Classes
- DelegatesResolutionToExtensions
- Exceptions thrown
`AMBIGUOUS_RESOLVER_EXTENSION`if there were several matched extensions for this operator.
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withLogContext(context: Map[String, String])(body: => Unit): Unit
- Attributes
- protected
- Definition Classes
- Logging
- object AsTableIdentifier
Extract legacy table identifier from a multi-part identifier.
Extract legacy table identifier from a multi-part identifier.
For legacy support only. Please use CatalogAndIdentifier instead on DSv2 code paths.
- Definition Classes
- LookupCatalog
- object CatalogAndIdentifier
Extract catalog and identifier from a multi-part name with the current catalog if needed.
Extract catalog and identifier from a multi-part name with the current catalog if needed. Catalog name takes precedence over identifier, but for a single-part name, identifier takes precedence over catalog name.
Note that, this pattern is used to look up permanent catalog objects like table, view, function, etc. If you need to look up temp objects like temp view, please do it separately before calling this pattern, as temp objects don't belong to any catalog.
- Definition Classes
- LookupCatalog
- object CatalogAndNamespace
Extract catalog and namespace from a multi-part name with the current catalog if needed.
Extract catalog and namespace from a multi-part name with the current catalog if needed. Catalog name takes precedence over namespaces.
- Definition Classes
- LookupCatalog
- object NonSessionCatalogAndIdentifier
Extract non-session catalog and identifier from a multi-part identifier.
Extract non-session catalog and identifier from a multi-part identifier.
- Definition Classes
- LookupCatalog
- object SessionCatalogAndIdentifier
Extract session catalog and identifier from a multi-part identifier.
Extract session catalog and identifier from a multi-part identifier.
- Definition Classes
- LookupCatalog
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)