GitHub user cloud-fan opened a pull request:

    https://github.com/apache/spark/pull/11410

    [SPARK-13456][SQL] fix creating encoders for case classes defined in Spark 
shell

    ## What changes were proposed in this pull request?
    
    case classes defined in REPL are wrapped by line classes, and we have a 
trick for scala 2.10 REPL to automatically register the wrapper classes to 
`OuterScope` so that we can use when create encoders.
    However, this trick doesn't work right after we upgrade to scala 2.11, and 
unfortunately the tests are only in scala 2.10, which makes this bug hidden 
until now.
    
    This PR moves the encoder tests to scala 2.11  `ReplSuite`, and fixes this 
bug by another approach(the previous trick can't port to scala 2.11 REPL): make 
`OuterScope` smarter that can detect classes defined in REPL and load line 
wrapper classes automatically. 
    
    
    ## How was this patch tested?
    
    the migrated encoder tests in `ReplSuite`


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cloud-fan/spark repl

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/11410.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #11410
    
----
commit a2c461746b10fab4acac5e206a759a9bebbc7c29
Author: Wenchen Fan <[email protected]>
Date:   2016-02-26T13:09:34Z

    fix creating encoders for case classes defined in Spark shell

----


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to