&#010;Exception thrown while executing query:&#010;== Parsed Logical Plan ==&#010;'Project ['lead('key,1,null) windowspecdefinition('key,'value ASC,UnspecifiedFrame) AS 'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead('value,1,null) windowspecdefinition('key,'value ASC,UnspecifiedFrame) AS 'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518]&#010;+- Project [_1#130513 AS key#130515,_2#130514 AS value#130516]&#010; +- LocalRelation [_1#130513,_2#130514], [[1,1],[2,2],[1,1],[2,2]]&#010;&#010;== Analyzed Logical Plan ==&#010;'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame): int, 'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame): string&#010;Project ['lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518]&#010;+- Project [key#130515,value#130516,'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518,'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518]&#010; +- Window [key#130515,value#130516], [HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(key#130515,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(value#130516,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518], [key#130515], [value#130516 ASC]&#010; +- Project [key#130515,value#130516]&#010; +- Project [_1#130513 AS key#130515,_2#130514 AS value#130516]&#010; +- LocalRelation [_1#130513,_2#130514], [[1,1],[2,2],[1,1],[2,2]]&#010;&#010;== Optimized Logical Plan ==&#010;Project ['lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518]&#010;+- Window [key#130515,value#130516], [HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(key#130515,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(value#130516,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518], [key#130515], [value#130516 ASC]&#010; +- LocalRelation [key#130515,value#130516], [[1,1],[2,2],[1,1],[2,2]]&#010;&#010;== Physical Plan ==&#010;Project ['lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518]&#010;+- Window [key#130515,value#130516], [HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(key#130515,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(value#130516,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518], [key#130515], [value#130516 ASC]&#010; +- Sort [key#130515 ASC,value#130516 ASC], false, 0&#010; +- TungstenExchange hashpartitioning(key#130515,2), None&#010; +- ConvertToUnsafe&#010; +- LocalTableScan [key#130515,value#130516], [[1,1],[2,2],[1,1],[2,2]]&#010;== Exception ==&#010;org.apache.spark.sql.catalyst.errors.package$TreeNodeException: execute, tree:&#010;TungstenExchange hashpartitioning(key#130515,2), None&#010;+- ConvertToUnsafe&#010; +- LocalTableScan [key#130515,value#130516], [[1,1],[2,2],[1,1],[2,2]]&#010;&#010;org.apache.spark.sql.catalyst.errors.package$TreeNodeException: execute, tree:&#010;TungstenExchange hashpartitioning(key#130515,2), None&#010;+- ConvertToUnsafe&#010; +- LocalTableScan [key#130515,value#130516], [[1,1],[2,2],[1,1],[2,2]]&#010;&#010; at org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:49)&#010; at org.apache.spark.sql.execution.Exchange.doExecute(Exchange.scala:247)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)&#010; at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)&#010; at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)&#010; at org.apache.spark.sql.execution.Sort.doExecute(Sort.scala:64)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)&#010; at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)&#010; at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)&#010; at org.apache.spark.sql.execution.Window.doExecute(Window.scala:245)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)&#010; at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)&#010; at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)&#010; at org.apache.spark.sql.execution.Project.doExecute(basicOperators.scala:46)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)&#010; at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)&#010; at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)&#010; at org.apache.spark.sql.execution.SparkPlan.executeCollect(SparkPlan.scala:166)&#010; at org.apache.spark.sql.execution.SparkPlan.executeCollectPublic(SparkPlan.scala:174)&#010; at org.apache.spark.sql.DataFrame$$anonfun$org$apache$spark$sql$DataFrame$$execute$1$1.apply(DataFrame.scala:1499)&#010; at org.apache.spark.sql.DataFrame$$anonfun$org$apache$spark$sql$DataFrame$$execute$1$1.apply(DataFrame.scala:1499)&#010; at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:56)&#010; at org.apache.spark.sql.DataFrame.withNewExecutionId(DataFrame.scala:2086)&#010; at org.apache.spark.sql.DataFrame.org$apache$spark$sql$DataFrame$$execute$1(DataFrame.scala:1498)&#010; at org.apache.spark.sql.DataFrame$$anonfun$org$apache$spark$sql$DataFrame$$collect$1.apply(DataFrame.scala:1503)&#010; at org.apache.spark.sql.DataFrame$$anonfun$org$apache$spark$sql$DataFrame$$collect$1.apply(DataFrame.scala:1503)&#010; at org.apache.spark.sql.DataFrame.withCallback(DataFrame.scala:2099)&#010; at org.apache.spark.sql.DataFrame.org$apache$spark$sql$DataFrame$$collect(DataFrame.scala:1503)&#010; at org.apache.spark.sql.DataFrame.collect(DataFrame.scala:1480)&#010; at org.apache.spark.sql.QueryTest$.checkAnswer(QueryTest.scala:313)&#010; at org.apache.spark.sql.QueryTest.checkAnswer(QueryTest.scala:133)&#010; at org.apache.spark.sql.hive.HiveDataFrameWindowSuite$$anonfun$1.apply$mcV$sp(HiveDataFrameWindowSuite.scala:33)&#010; at org.apache.spark.sql.hive.HiveDataFrameWindowSuite$$anonfun$1.apply(HiveDataFrameWindowSuite.scala:29)&#010; at org.apache.spark.sql.hive.HiveDataFrameWindowSuite$$anonfun$1.apply(HiveDataFrameWindowSuite.scala:29)&#010; at org.scalatest.Transformer$$anonfun$apply$1.apply$mcV$sp(Transformer.scala:22)&#010; at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)&#010; at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)&#010; at org.scalatest.Transformer.apply(Transformer.scala:22)&#010; at org.scalatest.Transformer.apply(Transformer.scala:20)&#010; at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:166)&#010; at org.apache.spark.SparkFunSuite.withFixture(SparkFunSuite.scala:42)&#010; at org.scalatest.FunSuiteLike$class.invokeWithFixture$1(FunSuiteLike.scala:163)&#010; at org.scalatest.FunSuiteLike$$anonfun$runTest$1.apply(FunSuiteLike.scala:175)&#010; at org.scalatest.FunSuiteLike$$anonfun$runTest$1.apply(FunSuiteLike.scala:175)&#010; at org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)&#010; at org.scalatest.FunSuiteLike$class.runTest(FunSuiteLike.scala:175)&#010; at org.scalatest.FunSuite.runTest(FunSuite.scala:1555)&#010; at org.scalatest.FunSuiteLike$$anonfun$runTests$1.apply(FunSuiteLike.scala:208)&#010; at org.scalatest.FunSuiteLike$$anonfun$runTests$1.apply(FunSuiteLike.scala:208)&#010; at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:413)&#010; at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)&#010; at scala.collection.immutable.List.foreach(List.scala:318)&#010; at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)&#010; at org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:396)&#010; at org.scalatest.SuperEngine.runTestsImpl(Engine.scala:483)&#010; at org.scalatest.FunSuiteLike$class.runTests(FunSuiteLike.scala:208)&#010; at org.scalatest.FunSuite.runTests(FunSuite.scala:1555)&#010; at org.scalatest.Suite$class.run(Suite.scala:1424)&#010; at org.scalatest.FunSuite.org$scalatest$FunSuiteLike$$super$run(FunSuite.scala:1555)&#010; at org.scalatest.FunSuiteLike$$anonfun$run$1.apply(FunSuiteLike.scala:212)&#010; at org.scalatest.FunSuiteLike$$anonfun$run$1.apply(FunSuiteLike.scala:212)&#010; at org.scalatest.SuperEngine.runImpl(Engine.scala:545)&#010; at org.scalatest.FunSuiteLike$class.run(FunSuiteLike.scala:212)&#010; at org.scalatest.FunSuite.run(FunSuite.scala:1555)&#010; at org.scalatest.Suite$class.callExecuteOnSuite$1(Suite.scala:1492)&#010; at org.scalatest.Suite$$anonfun$runNestedSuites$1.apply(Suite.scala:1528)&#010; at org.scalatest.Suite$$anonfun$runNestedSuites$1.apply(Suite.scala:1526)&#010; at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)&#010; at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)&#010; at org.scalatest.Suite$class.runNestedSuites(Suite.scala:1526)&#010; at org.scalatest.tools.DiscoverySuite.runNestedSuites(DiscoverySuite.scala:29)&#010; at org.scalatest.Suite$class.run(Suite.scala:1421)&#010; at org.scalatest.tools.DiscoverySuite.run(DiscoverySuite.scala:29)&#010; at org.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:55)&#010; at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2563)&#010; at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2557)&#010; at scala.collection.immutable.List.foreach(List.scala:318)&#010; at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2557)&#010; at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1044)&#010; at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1043)&#010; at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2722)&#010; at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1043)&#010; at org.scalatest.tools.Runner$.main(Runner.scala:860)&#010; at org.scalatest.tools.Runner.main(Runner.scala)&#010;Caused by: java.lang.IllegalStateException: Cannot call methods on a stopped SparkContext.&#010;This stopped SparkContext was created at:&#010;&#010;org.apache.spark.sql.hive.StatisticsSuite.<init>(StatisticsSuite.scala:28)&#010;sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)&#010;sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)&#010;sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)&#010;java.lang.reflect.Constructor.newInstance(Constructor.java:526)&#010;java.lang.Class.newInstance(Class.java:374)&#010;org.scalatest.tools.DiscoverySuite$.getSuiteInstance(DiscoverySuite.scala:69)&#010;org.scalatest.tools.DiscoverySuite$$anonfun$1.apply(DiscoverySuite.scala:38)&#010;org.scalatest.tools.DiscoverySuite$$anonfun$1.apply(DiscoverySuite.scala:37)&#010;scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)&#010;scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)&#010;scala.collection.Iterator$class.foreach(Iterator.scala:727)&#010;scala.collection.AbstractIterator.foreach(Iterator.scala:1157)&#010;scala.collection.IterableLike$class.foreach(IterableLike.scala:72)&#010;scala.collection.AbstractIterable.foreach(Iterable.scala:54)&#010;scala.collection.TraversableLike$class.map(TraversableLike.scala:244)&#010;scala.collection.AbstractTraversable.map(Traversable.scala:105)&#010;org.scalatest.tools.DiscoverySuite.<init>(DiscoverySuite.scala:37)&#010;org.scalatest.tools.Runner$.genDiscoSuites$1(Runner.scala:2390)&#010;org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2475)&#010;&#010;The currently active SparkContext was created at:&#010;&#010;(No active SparkContext.)&#010; &#010; at org.apache.spark.SparkContext.org$apache$spark$SparkContext$$assertNotStopped(SparkContext.scala:106)&#010; at org.apache.spark.SparkContext.defaultParallelism(SparkContext.scala:2086)&#010; at org.apache.spark.SparkContext.parallelize$default$2(SparkContext.scala:728)&#010; at org.apache.spark.sql.execution.LocalTableScan.rdd$lzycompute(LocalTableScan.scala:32)&#010; at org.apache.spark.sql.execution.LocalTableScan.rdd(LocalTableScan.scala:32)&#010; at org.apache.spark.sql.execution.LocalTableScan.doExecute(LocalTableScan.scala:34)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)&#010; at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)&#010; at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)&#010; at org.apache.spark.sql.execution.ConvertToUnsafe.doExecute(rowFormatConverters.scala:38)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)&#010; at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)&#010; at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)&#010; at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)&#010; at org.apache.spark.sql.execution.Exchange.prepareShuffleDependency(Exchange.scala:164)&#010; at org.apache.spark.sql.execution.Exchange$$anonfun$doExecute$1.apply(Exchange.scala:254)&#010; at org.apache.spark.sql.execution.Exchange$$anonfun$doExecute$1.apply(Exchange.scala:248)&#010; at org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:48)&#010; ... 87 more&#010;&#010;


      org.scalatest.exceptions.TestFailedException: 
Exception thrown while executing query:
== Parsed Logical Plan ==
'Project ['lead('key,1,null) windowspecdefinition('key,'value ASC,UnspecifiedFrame) AS 'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead('value,1,null) windowspecdefinition('key,'value ASC,UnspecifiedFrame) AS 'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518]
+- Project [_1#130513 AS key#130515,_2#130514 AS value#130516]
   +- LocalRelation [_1#130513,_2#130514], [[1,1],[2,2],[1,1],[2,2]]

== Analyzed Logical Plan ==
'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame): int, 'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame): string
Project ['lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518]
+- Project [key#130515,value#130516,'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518,'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518]
   +- Window [key#130515,value#130516], [HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(key#130515,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(value#130516,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518], [key#130515], [value#130516 ASC]
      +- Project [key#130515,value#130516]
         +- Project [_1#130513 AS key#130515,_2#130514 AS value#130516]
            +- LocalRelation [_1#130513,_2#130514], [[1,1],[2,2],[1,1],[2,2]]

== Optimized Logical Plan ==
Project ['lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518]
+- Window [key#130515,value#130516], [HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(key#130515,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(value#130516,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518], [key#130515], [value#130516 ASC]
   +- LocalRelation [key#130515,value#130516], [[1,1],[2,2],[1,1],[2,2]]

== Physical Plan ==
Project ['lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518]
+- Window [key#130515,value#130516], [HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(key#130515,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(key,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130517,HiveWindowFunction#org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead(value#130516,1,null) windowspecdefinition(key#130515,value#130516 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS 'lead(value,1,null) windowspecdefinition(key,value ASC,UnspecifiedFrame)#130518], [key#130515], [value#130516 ASC]
   +- Sort [key#130515 ASC,value#130516 ASC], false, 0
      +- TungstenExchange hashpartitioning(key#130515,2), None
         +- ConvertToUnsafe
            +- LocalTableScan [key#130515,value#130516], [[1,1],[2,2],[1,1],[2,2]]
== Exception ==
org.apache.spark.sql.catalyst.errors.package$TreeNodeException: execute, tree:
TungstenExchange hashpartitioning(key#130515,2), None
+- ConvertToUnsafe
   +- LocalTableScan [key#130515,value#130516], [[1,1],[2,2],[1,1],[2,2]]

org.apache.spark.sql.catalyst.errors.package$TreeNodeException: execute, tree:
TungstenExchange hashpartitioning(key#130515,2), None
+- ConvertToUnsafe
   +- LocalTableScan [key#130515,value#130516], [[1,1],[2,2],[1,1],[2,2]]

	at org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:49)
	at org.apache.spark.sql.execution.Exchange.doExecute(Exchange.scala:247)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)
	at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)
	at org.apache.spark.sql.execution.Sort.doExecute(Sort.scala:64)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)
	at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)
	at org.apache.spark.sql.execution.Window.doExecute(Window.scala:245)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)
	at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)
	at org.apache.spark.sql.execution.Project.doExecute(basicOperators.scala:46)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)
	at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)
	at org.apache.spark.sql.execution.SparkPlan.executeCollect(SparkPlan.scala:166)
	at org.apache.spark.sql.execution.SparkPlan.executeCollectPublic(SparkPlan.scala:174)
	at org.apache.spark.sql.DataFrame$$anonfun$org$apache$spark$sql$DataFrame$$execute$1$1.apply(DataFrame.scala:1499)
	at org.apache.spark.sql.DataFrame$$anonfun$org$apache$spark$sql$DataFrame$$execute$1$1.apply(DataFrame.scala:1499)
	at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:56)
	at org.apache.spark.sql.DataFrame.withNewExecutionId(DataFrame.scala:2086)
	at org.apache.spark.sql.DataFrame.org$apache$spark$sql$DataFrame$$execute$1(DataFrame.scala:1498)
	at org.apache.spark.sql.DataFrame$$anonfun$org$apache$spark$sql$DataFrame$$collect$1.apply(DataFrame.scala:1503)
	at org.apache.spark.sql.DataFrame$$anonfun$org$apache$spark$sql$DataFrame$$collect$1.apply(DataFrame.scala:1503)
	at org.apache.spark.sql.DataFrame.withCallback(DataFrame.scala:2099)
	at org.apache.spark.sql.DataFrame.org$apache$spark$sql$DataFrame$$collect(DataFrame.scala:1503)
	at org.apache.spark.sql.DataFrame.collect(DataFrame.scala:1480)
	at org.apache.spark.sql.QueryTest$.checkAnswer(QueryTest.scala:313)
	at org.apache.spark.sql.QueryTest.checkAnswer(QueryTest.scala:133)
	at org.apache.spark.sql.hive.HiveDataFrameWindowSuite$$anonfun$1.apply$mcV$sp(HiveDataFrameWindowSuite.scala:33)
	at org.apache.spark.sql.hive.HiveDataFrameWindowSuite$$anonfun$1.apply(HiveDataFrameWindowSuite.scala:29)
	at org.apache.spark.sql.hive.HiveDataFrameWindowSuite$$anonfun$1.apply(HiveDataFrameWindowSuite.scala:29)
	at org.scalatest.Transformer$$anonfun$apply$1.apply$mcV$sp(Transformer.scala:22)
	at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
	at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
	at org.scalatest.Transformer.apply(Transformer.scala:22)
	at org.scalatest.Transformer.apply(Transformer.scala:20)
	at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:166)
	at org.apache.spark.SparkFunSuite.withFixture(SparkFunSuite.scala:42)
	at org.scalatest.FunSuiteLike$class.invokeWithFixture$1(FunSuiteLike.scala:163)
	at org.scalatest.FunSuiteLike$$anonfun$runTest$1.apply(FunSuiteLike.scala:175)
	at org.scalatest.FunSuiteLike$$anonfun$runTest$1.apply(FunSuiteLike.scala:175)
	at org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
	at org.scalatest.FunSuiteLike$class.runTest(FunSuiteLike.scala:175)
	at org.scalatest.FunSuite.runTest(FunSuite.scala:1555)
	at org.scalatest.FunSuiteLike$$anonfun$runTests$1.apply(FunSuiteLike.scala:208)
	at org.scalatest.FunSuiteLike$$anonfun$runTests$1.apply(FunSuiteLike.scala:208)
	at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:413)
	at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
	at org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:396)
	at org.scalatest.SuperEngine.runTestsImpl(Engine.scala:483)
	at org.scalatest.FunSuiteLike$class.runTests(FunSuiteLike.scala:208)
	at org.scalatest.FunSuite.runTests(FunSuite.scala:1555)
	at org.scalatest.Suite$class.run(Suite.scala:1424)
	at org.scalatest.FunSuite.org$scalatest$FunSuiteLike$$super$run(FunSuite.scala:1555)
	at org.scalatest.FunSuiteLike$$anonfun$run$1.apply(FunSuiteLike.scala:212)
	at org.scalatest.FunSuiteLike$$anonfun$run$1.apply(FunSuiteLike.scala:212)
	at org.scalatest.SuperEngine.runImpl(Engine.scala:545)
	at org.scalatest.FunSuiteLike$class.run(FunSuiteLike.scala:212)
	at org.scalatest.FunSuite.run(FunSuite.scala:1555)
	at org.scalatest.Suite$class.callExecuteOnSuite$1(Suite.scala:1492)
	at org.scalatest.Suite$$anonfun$runNestedSuites$1.apply(Suite.scala:1528)
	at org.scalatest.Suite$$anonfun$runNestedSuites$1.apply(Suite.scala:1526)
	at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
	at org.scalatest.Suite$class.runNestedSuites(Suite.scala:1526)
	at org.scalatest.tools.DiscoverySuite.runNestedSuites(DiscoverySuite.scala:29)
	at org.scalatest.Suite$class.run(Suite.scala:1421)
	at org.scalatest.tools.DiscoverySuite.run(DiscoverySuite.scala:29)
	at org.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:55)
	at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2563)
	at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2557)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2557)
	at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1044)
	at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1043)
	at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2722)
	at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1043)
	at org.scalatest.tools.Runner$.main(Runner.scala:860)
	at org.scalatest.tools.Runner.main(Runner.scala)
Caused by: java.lang.IllegalStateException: Cannot call methods on a stopped SparkContext.
This stopped SparkContext was created at:

org.apache.spark.sql.hive.StatisticsSuite.<init>(StatisticsSuite.scala:28)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
java.lang.Class.newInstance(Class.java:374)
org.scalatest.tools.DiscoverySuite$.getSuiteInstance(DiscoverySuite.scala:69)
org.scalatest.tools.DiscoverySuite$$anonfun$1.apply(DiscoverySuite.scala:38)
org.scalatest.tools.DiscoverySuite$$anonfun$1.apply(DiscoverySuite.scala:37)
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
scala.collection.Iterator$class.foreach(Iterator.scala:727)
scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
scala.collection.AbstractIterable.foreach(Iterable.scala:54)
scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
scala.collection.AbstractTraversable.map(Traversable.scala:105)
org.scalatest.tools.DiscoverySuite.<init>(DiscoverySuite.scala:37)
org.scalatest.tools.Runner$.genDiscoSuites$1(Runner.scala:2390)
org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2475)

The currently active SparkContext was created at:

(No active SparkContext.)
         
	at org.apache.spark.SparkContext.org$apache$spark$SparkContext$$assertNotStopped(SparkContext.scala:106)
	at org.apache.spark.SparkContext.defaultParallelism(SparkContext.scala:2086)
	at org.apache.spark.SparkContext.parallelize$default$2(SparkContext.scala:728)
	at org.apache.spark.sql.execution.LocalTableScan.rdd$lzycompute(LocalTableScan.scala:32)
	at org.apache.spark.sql.execution.LocalTableScan.rdd(LocalTableScan.scala:32)
	at org.apache.spark.sql.execution.LocalTableScan.doExecute(LocalTableScan.scala:34)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)
	at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)
	at org.apache.spark.sql.execution.ConvertToUnsafe.doExecute(rowFormatConverters.scala:38)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)
	at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)
	at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)
	at org.apache.spark.sql.execution.Exchange.prepareShuffleDependency(Exchange.scala:164)
	at org.apache.spark.sql.execution.Exchange$$anonfun$doExecute$1.apply(Exchange.scala:254)
	at org.apache.spark.sql.execution.Exchange$$anonfun$doExecute$1.apply(Exchange.scala:248)
	at org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:48)
	... 87 more

          
      at org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:495)
      at org.scalatest.FunSuite.newAssertionFailedException(FunSuite.scala:1555)
      at org.scalatest.Assertions$class.fail(Assertions.scala:1328)
      at org.scalatest.FunSuite.fail(FunSuite.scala:1555)
      at org.apache.spark.sql.QueryTest.checkAnswer(QueryTest.scala:134)
      at org.apache.spark.sql.hive.HiveDataFrameWindowSuite$$anonfun$1.apply$mcV$sp(HiveDataFrameWindowSuite.scala:33)
      at org.apache.spark.sql.hive.HiveDataFrameWindowSuite$$anonfun$1.apply(HiveDataFrameWindowSuite.scala:29)
      at org.apache.spark.sql.hive.HiveDataFrameWindowSuite$$anonfun$1.apply(HiveDataFrameWindowSuite.scala:29)
      at org.scalatest.Transformer$$anonfun$apply$1.apply$mcV$sp(Transformer.scala:22)
      at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
      at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
      at org.scalatest.Transformer.apply(Transformer.scala:22)
      at org.scalatest.Transformer.apply(Transformer.scala:20)
      at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:166)
      at org.apache.spark.SparkFunSuite.withFixture(SparkFunSuite.scala:42)
      at org.scalatest.FunSuiteLike$class.invokeWithFixture$1(FunSuiteLike.scala:163)
      at org.scalatest.FunSuiteLike$$anonfun$runTest$1.apply(FunSuiteLike.scala:175)
      at org.scalatest.FunSuiteLike$$anonfun$runTest$1.apply(FunSuiteLike.scala:175)
      at org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
      at org.scalatest.FunSuiteLike$class.runTest(FunSuiteLike.scala:175)
      at org.scalatest.FunSuite.runTest(FunSuite.scala:1555)
      at org.scalatest.FunSuiteLike$$anonfun$runTests$1.apply(FunSuiteLike.scala:208)
      at org.scalatest.FunSuiteLike$$anonfun$runTests$1.apply(FunSuiteLike.scala:208)
      at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:413)
      at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
      at scala.collection.immutable.List.foreach(List.scala:318)
      at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
      at org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:396)
      at org.scalatest.SuperEngine.runTestsImpl(Engine.scala:483)
      at org.scalatest.FunSuiteLike$class.runTests(FunSuiteLike.scala:208)
      at org.scalatest.FunSuite.runTests(FunSuite.scala:1555)
      at org.scalatest.Suite$class.run(Suite.scala:1424)
      at org.scalatest.FunSuite.org$scalatest$FunSuiteLike$$super$run(FunSuite.scala:1555)
      at org.scalatest.FunSuiteLike$$anonfun$run$1.apply(FunSuiteLike.scala:212)
      at org.scalatest.FunSuiteLike$$anonfun$run$1.apply(FunSuiteLike.scala:212)
      at org.scalatest.SuperEngine.runImpl(Engine.scala:545)
      at org.scalatest.FunSuiteLike$class.run(FunSuiteLike.scala:212)
      at org.scalatest.FunSuite.run(FunSuite.scala:1555)
      at org.scalatest.Suite$class.callExecuteOnSuite$1(Suite.scala:1492)
      at org.scalatest.Suite$$anonfun$runNestedSuites$1.apply(Suite.scala:1528)
      at org.scalatest.Suite$$anonfun$runNestedSuites$1.apply(Suite.scala:1526)
      at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
      at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
      at org.scalatest.Suite$class.runNestedSuites(Suite.scala:1526)
      at org.scalatest.tools.DiscoverySuite.runNestedSuites(DiscoverySuite.scala:29)
      at org.scalatest.Suite$class.run(Suite.scala:1421)
      at org.scalatest.tools.DiscoverySuite.run(DiscoverySuite.scala:29)
      at org.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:55)
      at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2563)
      at org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2557)
      at scala.collection.immutable.List.foreach(List.scala:318)
      at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2557)
      at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1044)
      at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1043)
      at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2722)
      at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1043)
      at org.scalatest.tools.Runner$.main(Runner.scala:860)
      at org.scalatest.tools.Runner.main(Runner.scala)