Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
case c: CreateTableUsingAsSelect if !c.temporary =>
sys.error("Tables created with SQLContext must be TEMPORARY. Use a HiveContext instead.")

case LogicalDescribeCommand(table, isExtended) =>
case describe @ LogicalDescribeCommand(table, isExtended) =>
val resultPlan = self.sqlContext.executePlan(table).executedPlan
ExecutedCommand(
RunnableDescribeCommand(resultPlan, resultPlan.output, isExtended)) :: Nil
RunnableDescribeCommand(resultPlan, describe.output, isExtended)) :: Nil

case _ => Nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,10 @@ class DDLTestSuite extends DataSourceTest {
Row("arrayType", "array<string>", ""),
Row("structType", "struct<f1:string,f2:int>", "")
))

test("SPARK-7686 DescribeCommand should have correct physical plan output attributes") {
val attributes = sql("describe ddlPeople").queryExecution.executedPlan.output
assert(attributes.map(_.name) === Seq("col_name", "data_type", "comment"))
assert(attributes.map(_.dataType).toSet === Set(StringType))
}
}