GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/14114
[SPARK-16458][SQL] SessionCatalog should support `listColumns` for
temporary tables
## What changes were proposed in this pull request?
Temporary tables are used frequently, but `spark.catalog.listColumns` does
not support those tables. This PR make `SessionCatalog` supports temporary
table column listing.
**Before**
```scala
scala> spark.range(10).createOrReplaceTempView("t1")
scala> spark.catalog.listTables().collect()
res1: Array[org.apache.spark.sql.catalog.Table] = Array(Table[name='t1',
tableType='TEMPORARY', isTemporary='true'])
scala> spark.catalog.listColumns("t1").collect()
org.apache.spark.sql.AnalysisException: Table 't1' does not exist in
database 'default'.;
```
**After**
```
scala> spark.catalog.listColumns("t1").collect()
res2: Array[org.apache.spark.sql.catalog.Column] = Array(Column[name='id',
description='id', dataType='bigint', nullable='false', isPartition='false',
isBucket='false'])
```
## How was this patch tested?
Pass the Jenkins tests including a new testcase.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark SPARK-16458
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14114.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #14114
----
commit 46196a44d18426a107b480b8157c5accedecbbd1
Author: Dongjoon Hyun <[email protected]>
Date: 2016-07-09T09:54:39Z
[SPARK-16458][SQL] SessionCatalog should support `listColumns` for
temporary tables
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]