-
Notifications
You must be signed in to change notification settings - Fork 21
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
Map#mapValues is not serializable #7005
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7005?orig=1 |
Artūras Šlajus (arturaz) said (edited by @Blaisorblade on Mar 25, 2013 8:13:30 AM UTC): Use {code}.mapValues( ... ).map(identity){code} as a workaround |
Heikki Vesalainen (hvesalai) said: |
Heikki Vesalainen (hvesalai) said: |
Allan Douglas R. de Oliveira (douglaz) said: |
Jeffrey Aguilera (jeffrey.aguilera) said: |
Art Peel (foundart) said: |
@Blaisorblade said: See also #4776. |
Heikki Vesalainen (hvesalai) said: |
Michael Pfaffenberger (glitch253) said: |
@Ichoran said: |
Jeffrey Aguilera (jeffrey.aguilera) said: |
@Ichoran said: That does raise a problem of having arbitrary numbers of the same map being duplicated, but I can't see a reliable path to correctness otherwise. |
@Blaisorblade said (edited on Mar 29, 2015 2:33:27 PM UTC):
by giving the programmer control over what gets in a closure. Yes, that's annoying, but things can't be perfect. Here's the current implementation of spores. In a perfect world, the type system could maybe distinguish between serializable and not serializable map values, depending on whether all involved closures are serializable. But this seems a follow-up research project, if it's actually plausible at all. |
Meir Maor (meirmaor) said: |
Meir Maor (meirmaor) said: |
Sarah Gerweck (gerweck) said: |
…d CatalogTable ### What changes were proposed in this pull request? Replace `toMap` by `map(identity).toMap` while getting canonicalized representation of `CatalogTable`. `CatalogTable` became not serializable after #31112 due to usage of `filterKeys`. The workaround was taken from scala/bug#7005. ### Why are the changes needed? This prevents the errors like: ``` [info] org.apache.spark.SparkException: Job aborted due to stage failure: Task not serializable: java.io.NotSerializableException: scala.collection.immutable.MapLike$$anon$1 [info] Cause: java.io.NotSerializableException: scala.collection.immutable.MapLike$$anon$1 ``` ### Does this PR introduce _any_ user-facing change? Should not. ### How was this patch tested? By running the test suite affected by #31112: ``` $ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *AlterTableDropPartitionSuite" ``` Closes #31197 from MaxGekk/fix-caching-hive-table-2-followup. Authored-by: Max Gekk <max.gekk@gmail.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
…d CatalogTable ### What changes were proposed in this pull request? Replace `toMap` by `map(identity).toMap` while getting canonicalized representation of `CatalogTable`. `CatalogTable` became not serializable after #31112 due to usage of `filterKeys`. The workaround was taken from scala/bug#7005. ### Why are the changes needed? This prevents the errors like: ``` [info] org.apache.spark.SparkException: Job aborted due to stage failure: Task not serializable: java.io.NotSerializableException: scala.collection.immutable.MapLike$$anon$1 [info] Cause: java.io.NotSerializableException: scala.collection.immutable.MapLike$$anon$1 ``` ### Does this PR introduce _any_ user-facing change? Should not. ### How was this patch tested? By running the test suite affected by #31112: ``` $ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *AlterTableDropPartitionSuite" ``` Closes #31197 from MaxGekk/fix-caching-hive-table-2-followup. Authored-by: Max Gekk <max.gekk@gmail.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com> (cherry picked from commit c3d81fb) Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
…d CatalogTable ### What changes were proposed in this pull request? Replace `toMap` by `map(identity).toMap` while getting canonicalized representation of `CatalogTable`. `CatalogTable` became not serializable after #31112 due to usage of `filterKeys`. The workaround was taken from scala/bug#7005. ### Why are the changes needed? This prevents the errors like: ``` [info] org.apache.spark.SparkException: Job aborted due to stage failure: Task not serializable: java.io.NotSerializableException: scala.collection.immutable.MapLike$$anon$1 [info] Cause: java.io.NotSerializableException: scala.collection.immutable.MapLike$$anon$1 ``` ### Does this PR introduce _any_ user-facing change? Should not. ### How was this patch tested? By running the test suite affected by #31112: ``` $ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *AlterTableDropPartitionSuite" ``` Closes #31197 from MaxGekk/fix-caching-hive-table-2-followup. Authored-by: Max Gekk <max.gekk@gmail.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com> (cherry picked from commit c3d81fb) Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
The text was updated successfully, but these errors were encountered: