GitHub user kiszk opened a pull request:

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

    [SPARK-18284][SQL] Make ExpressionEncoder.serializer.nullable precise

    ## What changes were proposed in this pull request?
    
    This PR makes `ExpressionEncoder.serializer.nullable` for flat encoder for 
a primitive type `false`. Since it is `true` for now, it is too conservative.
    While `ExpressionEncoder.schema` has correct information (e.g. 
`<IntegerType, false>`), `serializer.head.nullable` of `ExpressionEncoder`, 
which got from `encoderFor[T]`, is always false. It is too conservative.
    
    This is accomplished by checking whether a type is one of primitive types. 
If it is `true`, `nullable` should be `false`.
    
    ## How was this patch tested?
    
    Added new tests for encoder and dataframe


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

    $ git pull https://github.com/kiszk/spark SPARK-18284

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

    https://github.com/apache/spark/pull/15780.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 #15780
    
----
commit 6ec2fd286b2608156abbddf426f0eae496728341
Author: Kazuaki Ishizaki <[email protected]>
Date:   2016-11-05T06:07:38Z

    initial commit

----


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