Skip to content

Commit

Permalink
Copy rows to present immutable data to users
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed Jun 2, 2014
1 parent 8250976 commit bdc4a14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ abstract class SparkPlan extends QueryPlan[SparkPlan] with Logging {
/**
* Runs this query returning the result as an array.
*/
def executeCollect(): Array[Row] = execute().collect()
def executeCollect(): Array[Row] = execute().map(_.copy()).collect()

protected def buildRow(values: Seq[Any]): Row =
new GenericRow(values.toArray)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class ParquetQuerySuite extends QueryTest with FunSuite with BeforeAndAfterAll {
}

test("insert (appending) to same table via Scala API") {
sql("INSERT INTO testsource SELECT * FROM testsource").collect()
sql("INSERT INTO testsource SELECT * FROM testsource")
val double_rdd = sql("SELECT * FROM testsource").collect()
assert(double_rdd != null)
assert(double_rdd.size === 30)
Expand Down

0 comments on commit bdc4a14

Please sign in to comment.