Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-14146

Imported implicits can't be found in Spark REPL in some cases

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Incomplete
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: Spark Core, SQL
    • Labels:

      Description

      class I(i: Int) {
        def double: Int = i * 2
      }
      
      class Context {
        implicit def toI(i: Int): I = new I(i)
      }
      
      val c = new Context
      import c._
      
      // OK
      1.double
      
      // Fail
      class A; 1.double
      

      The above code snippets can work in Scala REPL however.

      This will affect our Dataset functionality, for example:

      class A; Seq(1 -> "a").toDS() // fail
      

      or in paste mode:

      :paste
      class A
      Seq(1 -> "a").toDS() // fail
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cloud_fan Wenchen Fan
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: