cloud-fan commented on code in PR #43959:
URL: https://github.com/apache/spark/pull/43959#discussion_r1403470547
##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -439,12 +439,12 @@ class CatalogImpl(sparkSession: SparkSession) extends
Catalog {
* `Database` can be found.
*/
override def getDatabase(dbName: String): Database = {
- val namespace = resolveNamespace(dbName)
- val plan = UnresolvedNamespace(namespace)
+ val plan =
DescribeNamespace(UnresolvedNamespace(resolveNamespace(dbName)), false)
sparkSession.sessionState.executePlan(plan).analyzed match {
- case ResolvedNamespace(catalog, namespace) =>
+ case DescribeNamespace(ResolvedNamespace(catalog, namespace), _, _) =>
getNamespace(catalog, namespace)
Review Comment:
So we do not fully leverage the logical plan framework yet, as here we still
call catalog APIs to get namespace metadata. Shall we add a new logical plan
for getting namespace metadata? Then we can use it here and in
`DescribeNamespace`.
Or we can add a new boolean flag `fetchMetadata` in `UnresolvedNamespace`,
and put the metadata in `ResolvedNamespace` if the flag is true, else put
Map.empty
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]