-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-17761][SQL] Remove MutableRow #15333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
cc @cloud-fan we have discussed this in your MutableProjection PR. |
|
Test build #66270 has finished for PR 15333 at commit
|
|
Test build #66275 has finished for PR 15333 at commit
|
|
Test build #66277 has finished for PR 15333 at commit
|
|
Test build #66286 has finished for PR 15333 at commit
|
|
Would be nice to add a simple example in the PR description to illustrate why we can't ensure that a |
# Conflicts: # sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateMutableProjection.scala
|
Test build #66327 has finished for PR 15333 at commit
|
# Conflicts: # sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateMutableProjection.scala
|
This seems like a reasonable simplification to me. A little bit of history (though this has diverged significantly, so don't take this authoritative): I think this complexity all stems from |
|
Test build #66330 has finished for PR 15333 at commit
|
|
Merging to master. Thanks for commenting. |
## What changes were proposed in this pull request? In practice we cannot guarantee that an `InternalRow` is immutable. This makes the `MutableRow` almost redundant. This PR folds `MutableRow` into `InternalRow`. The code below illustrates the immutability issue with InternalRow: ```scala import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.GenericMutableRow val struct = new GenericMutableRow(1) val row = InternalRow(struct, 1) println(row) scala> [[null], 1] struct.setInt(0, 42) println(row) scala> [[42], 1] ``` This might be somewhat controversial, so feedback is appreciated. ## How was this patch tested? Existing tests. Author: Herman van Hovell <[email protected]> Closes apache#15333 from hvanhovell/SPARK-17761.
What changes were proposed in this pull request?
In practice we cannot guarantee that an
InternalRowis immutable. This makes theMutableRowalmost redundant. This PR foldsMutableRowintoInternalRow.The code below illustrates the immutability issue with InternalRow:
This might be somewhat controversial, so feedback is appreciated.
How was this patch tested?
Existing tests.