Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14114#discussion_r70305796
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
 ---
    @@ -246,9 +246,27 @@ class SessionCatalog(
       def getTableMetadata(name: TableIdentifier): CatalogTable = {
         val db = 
formatDatabaseName(name.database.getOrElse(getCurrentDatabase))
         val table = formatTableName(name.table)
    -    requireDbExists(db)
    -    requireTableExists(TableIdentifier(table, Some(db)))
    -    externalCatalog.getTable(db, table)
    +    val tid = TableIdentifier(table)
    +    if (name.database.isEmpty && isTemporaryTable(tid)) {
    +      CatalogTable(
    +        identifier = tid,
    +        tableType = CatalogTableType.VIEW,
    +        storage = CatalogStorageFormat.empty,
    +        schema = tempTables(table).output.map { c =>
    +          CatalogColumn(
    +            name = c.name,
    +            dataType = c.dataType.catalogString,
    +            nullable = c.nullable,
    +            comment = Option(c.name)
    --- End diff --
    
    The metadata can contain the comment, but it is a bit of a PITA to get out:
    `if (c.metadata.contains("comment")) Some(c.metadata.getString("comment")) 
else None `
    
    So I am fine with leaving this as it is...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to