aboutsummaryrefslogtreecommitdiff
path: root/sql/core
diff options
context:
space:
mode:
authorOopsOutOfMemory <victorshengli@126.com>2015-02-06 12:33:20 -0800
committerMichael Armbrust <michael@databricks.com>2015-02-06 12:33:20 -0800
commit0b7eb3f3b700080bf6cb810d092709a8a468e5db (patch)
tree3f59dfc04e63b2fc40a39868d94c35cbb561dde1 /sql/core
parenta958d60975147fb1afc76fcbd80f65ac8d78759a (diff)
downloadspark-0b7eb3f3b700080bf6cb810d092709a8a468e5db.tar.gz
spark-0b7eb3f3b700080bf6cb810d092709a8a468e5db.tar.bz2
spark-0b7eb3f3b700080bf6cb810d092709a8a468e5db.zip
[SPARK-5324][SQL] Results of describe can't be queried
Make below code works. ``` sql("DESCRIBE test").registerTempTable("describeTest") sql("SELECT * FROM describeTest").collect() ``` Author: OopsOutOfMemory <victorshengli@126.com> Author: Sheng, Li <OopsOutOfMemory@users.noreply.github.com> Closes #4249 from OopsOutOfMemory/desc_query and squashes the following commits: 6fee13d [OopsOutOfMemory] up-to-date e71430a [Sheng, Li] Update HiveOperatorQueryableSuite.scala 3ba1058 [OopsOutOfMemory] change to default argument aac7226 [OopsOutOfMemory] Merge branch 'master' into desc_query 68eb6dd [OopsOutOfMemory] Merge branch 'desc_query' of github.com:OopsOutOfMemory/spark into desc_query 354ad71 [OopsOutOfMemory] query describe command d541a35 [OopsOutOfMemory] refine test suite e1da481 [OopsOutOfMemory] refine test suite a780539 [OopsOutOfMemory] Merge branch 'desc_query' of github.com:OopsOutOfMemory/spark into desc_query 0015f82 [OopsOutOfMemory] code style dd0aaef [OopsOutOfMemory] code style c7d606d [OopsOutOfMemory] rename test suite 75f2342 [OopsOutOfMemory] refine code and test suite f942c9b [OopsOutOfMemory] initial 11559ae [OopsOutOfMemory] code style c5fdecf [OopsOutOfMemory] code style aeaea5f [OopsOutOfMemory] rename test suite ac2c3bb [OopsOutOfMemory] refine code and test suite 544573e [OopsOutOfMemory] initial
Diffstat (limited to 'sql/core')
-rw-r--r--sql/core/src/main/scala/org/apache/spark/sql/sources/ddl.scala11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/sources/ddl.scala b/sql/core/src/main/scala/org/apache/spark/sql/sources/ddl.scala
index 9c37e0169f..a692ef51b3 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/sources/ddl.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/sources/ddl.scala
@@ -296,11 +296,14 @@ private[sql] case class ResolvedDataSource(provider: Class[_], relation: BaseRel
private[sql] case class DescribeCommand(
table: LogicalPlan,
isExtended: Boolean) extends Command {
- override def output = Seq(
+ override val output = Seq(
// Column names are based on Hive.
- AttributeReference("col_name", StringType, nullable = false)(),
- AttributeReference("data_type", StringType, nullable = false)(),
- AttributeReference("comment", StringType, nullable = false)())
+ AttributeReference("col_name", StringType, nullable = false,
+ new MetadataBuilder().putString("comment", "name of the column").build())(),
+ AttributeReference("data_type", StringType, nullable = false,
+ new MetadataBuilder().putString("comment", "data type of the column").build())(),
+ AttributeReference("comment", StringType, nullable = false,
+ new MetadataBuilder().putString("comment", "comment of the column").build())())
}
private[sql] case class CreateTableUsing(