File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
core/src/main/scala/org/apache/spark/sql/execution
hive/src/test/scala/org/apache/spark/sql/hive Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ case class ExplainCommand(
8383 override protected [sql] lazy val sideEffectResult : Seq [String ] = this .toString.split(" \n " )
8484
8585 def execute (): RDD [Row ] = {
86- val explanation = sideEffectResult.mkString( " \n " )
87- context.sparkContext.parallelize(Seq ( new GenericRow ( Array [ Any ]( explanation))) , 1 )
86+ val explanation = sideEffectResult.map(row => new GenericRow ( Array [ Any ](row)) )
87+ context.sparkContext.parallelize(explanation, 1 )
8888 }
8989
9090 override def otherCopyArgs = context :: Nil
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ class JavaHiveQLSuite extends FunSuite {
4949
5050 def isExplanation (result : JavaSchemaRDD ) = {
5151 val explanation = result.collect().map(_.getString(0 ))
52- explanation.size == 1 && explanation.head.startsWith(explainCommandClassName)
52+ explanation.size > 1 && explanation.head.startsWith(explainCommandClassName)
5353 }
5454
5555 ignore(" Query Hive native command execution result" ) {
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ class HiveQuerySuite extends HiveComparisonTest {
169169
170170 def isExplanation (result : SchemaRDD ) = {
171171 val explanation = result.select(' plan ).collect().map { case Row (plan : String ) => plan }
172- explanation.size == 1 && explanation.head.startsWith(explainCommandClassName)
172+ explanation.size > 1 && explanation.head.startsWith(explainCommandClassName)
173173 }
174174
175175 test(" SPARK-1704: Explain commands as a SchemaRDD" ) {
You can’t perform that action at this time.
0 commit comments