GitHub user viirya opened a pull request:

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

    [SPARK-21567][SQL] Dataset should work with type alias

    ## What changes were proposed in this pull request?
    
    If we create a type alias for a type workable with Dataset, the type alias 
doesn't work with Dataset.
    
    A reproducible case looks like:
    
        object C {
          type TwoInt = (Int, Int)
          def tupleTypeAlias: TwoInt = (1, 1)
        }
    
        Seq(1).toDS().map(_ => ("", C.tupleTypeAlias))
    
    It throws an exception like:
    
        type T1 is not a class
        scala.ScalaReflectionException: type T1 is not a class
          at 
scala.reflect.api.Symbols$SymbolApi$class.asClass(Symbols.scala:275)
          ...
    
    This patch accesses the dealias of type in many places in `ScalaReflection` 
to fix it.
    
    ## How was this patch tested?
    
    Added test case.


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

    $ git pull https://github.com/viirya/spark-1 SPARK-21567

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

    https://github.com/apache/spark/pull/18813.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 #18813
    
----
commit 8a4b63d2928ee93410764d2b8cec33c562f0eeb7
Author: Liang-Chi Hsieh <vii...@gmail.com>
Date:   2017-08-02T06:59:54Z

    Dataset should work with type alias.

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to