amaliujia commented on code in PR #36586:
URL: https://github.com/apache/spark/pull/36586#discussion_r879816903
##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -125,6 +135,31 @@ class CatalogImpl(sparkSession: SparkSession) extends
Catalog {
isTemporary = isTemp)
}
+ private def makeTable(ident: Seq[String]): Table = {
+ val plan = UnresolvedTableOrView(ident, "Catalog.listTables", true)
+ val node = sparkSession.sessionState.executePlan(plan).analyzed
+ node match {
+ case t: ResolvedTable =>
+ val isExternal = t.table.properties().getOrDefault("external",
"false").equals("true")
+ new Table(
+ name = t.identifier.name(),
+ database = t.identifier.namespace().head,
+ description = t.table.properties().get("comment"),
+ tableType =
+ if (isExternal) CatalogTableType.EXTERNAL.name
+ else CatalogTableType.MANAGED.name,
+ isTemporary = false)
+ case v: ResolvedView =>
+ new Table(
Review Comment:
BTW this idea triggered a compatibility check issue
```
spark-sql: Failed binary compatibility check against
org.apache.spark:spark-sql_2.12:3.2.0! Found 1 potential problems (filtered 586)
[error] * method
this(java.lang.String,java.lang.String,java.lang.String,java.lang.String,Boolean)Unit
in class org.apache.spark.sql.catalog.Table's type is different in current
version, where it is
(java.lang.String,Array[java.lang.String],java.lang.String,java.lang.String,Boolean)Unit
instead of
(java.lang.String,java.lang.String,java.lang.String,java.lang.String,Boolean)Unit
```
How do we usually solve such issues?
--
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]