Github user ScrapCodes commented on a diff in the pull request:
https://github.com/apache/spark/pull/1635#discussion_r15526600
--- Diff: repl/src/main/scala/org/apache/spark/repl/SparkImports.scala ---
@@ -124,8 +125,14 @@ trait SparkImports {
// Single symbol imports might be implicits! See bug #1752.
Rather than
// try to finesse this, we will mimic all imports for now.
def keepHandler(handler: MemberHandler) = handler match {
- case _: ImportHandler => true
- case x => x.definesImplicit || (x.definedNames
exists wanted)
+ /* This case clause tries to "precisely" import only what is
required. And in this
+ * it may miss out on some implicits, because implicits are not
known in `wanted`. Thus
+ * it is suitable for defining classes. AFAIK while defining
classes implicits are not
+ * needed.*/
+ case h: ImportHandler if definedClass && !fallback =>
--- End diff --
This line is the actual fix. Here we just try to import what is directly
referenced and ignore everything else. This works for wildcard imports too.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---