[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15198738#comment-15198738 ] Reynold Xin commented on SPARK-13118: - [~jodersky] if you find other problems, please create new tickets for them. Thanks. > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Improvement > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust >Assignee: Jakob Odersky > Fix For: 2.0.0 > > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15196928#comment-15196928 ] Jakob Odersky commented on SPARK-13118: --- Upate: there was actually with inner classes (or package objects or any other synthetic class containing a dollar sign), however it only occurs when wrapped in option types. > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Improvement > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15196487#comment-15196487 ] Reynold Xin commented on SPARK-13118: - The JIRA is the same. > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Improvement > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15196463#comment-15196463 ] Jakob Odersky commented on SPARK-13118: --- Should I remove the JIRA ID from my existing PR? > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Improvement > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15196427#comment-15196427 ] Reynold Xin commented on SPARK-13118: - I'm moving this out to its own ticket. I think there is still a problem, and it lies in our way to get the full name of a class in ScalaReflection.scala {code} /** Returns the full class name for a type. */ def getClassNameFromType(tpe: `Type`): String = { tpe.erasure.typeSymbol.asClass.fullName } {code} According to the Scala doc here: http://www.scala-lang.org/api/2.11.7/scala-reflect/index.html#scala.reflect.api.Symbols$ClassSymbol {noformat} abstract def fullName: String The encoded full path name of this symbol, where outer names and inner names are separated by periods. {noformat} This causes problem with inner classes. For example {code} scala> Class.forName("org.apache.spark.mllib.tree.model.DecisionTreeModel.SaveLoadV1_0.SplitData") java.lang.ClassNotFoundException: org.apache.spark.mllib.tree.model.DecisionTreeModel.SaveLoadV1_0.SplitData at scala.reflect.internal.util.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:62) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) ... 49 elided scala> Class.forName("org.apache.spark.mllib.tree.model.DecisionTreeModel$SaveLoadV1_0$SplitData") res6: Class[_] = class org.apache.spark.mllib.tree.model.DecisionTreeModel$SaveLoadV1_0$SplitData {code} > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Improvement > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15194479#comment-15194479 ] Apache Spark commented on SPARK-13118: -- User 'jodersky' has created a pull request for this issue: https://github.com/apache/spark/pull/11708 > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15194465#comment-15194465 ] Jakob Odersky commented on SPARK-13118: --- Sure, I'll submit a PR with the test > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15194436#comment-15194436 ] Michael Armbrust commented on SPARK-13118: -- Its likely that we have fixed this with other refactorings. If you add that regression test I think we can close this. > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15194163#comment-15194163 ] Jakob Odersky commented on SPARK-13118: --- [~marmbrus], what's the issue at hand? Creating a simple test: {code} package object packageobject { case class Container(x: Int) } test("Package objects") { import packageobject._ val ds = Seq(Container(1)).toDS() checkDataset(ds, Container(1)) } {code} works without an issue. I might be testing something completely irrelevant but I can't quite make out the issue from the description. > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15193968#comment-15193968 ] Jakob Odersky commented on SPARK-13118: --- If I recall correctly, I couldn't reproduce the issue. I'll have another shot at it though > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15191798#comment-15191798 ] Reynold Xin commented on SPARK-13118: - Jakob - are you working on this? Would be great to find somebody to finish this and then close the 2.0 ticket for Dataset. > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15163902#comment-15163902 ] Jakob Odersky commented on SPARK-13118: --- Ah, just realized the context of this issue, it's part of the Dataset API super-ticket > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-13118) Support for classes defined in package objects
[ https://issues.apache.org/jira/browse/SPARK-13118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15163755#comment-15163755 ] Jakob Odersky commented on SPARK-13118: --- Hi Michael, what's the concrete issue you encounter, is it a (de-)serialization bug? I ran a simple test with DataFrames containing classes defined in package objects and everything worked out fine. I also quickly checked {{o.a.s.sql.catalyst.ScalaReflection}} but it seems that type names are always accessed via native scala reflection utilities. > Support for classes defined in package objects > -- > > Key: SPARK-13118 > URL: https://issues.apache.org/jira/browse/SPARK-13118 > Project: Spark > Issue Type: Sub-task > Components: SQL >Affects Versions: 1.6.0 >Reporter: Michael Armbrust > > When you define a class inside of a package object, the name ends up being > something like {{org.mycompany.project.package$MyClass}}. However, when > reflect on this we try and load {{org.mycompany.project.MyClass}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org