GitHub user chenghao-intel opened a pull request:

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

    [SPARK-4856] [SQL] NullType instead of StringType when sampling against 
empty string or nul...

    ```
    TestSQLContext.sparkContext.parallelize(
      
"""{"ip":"27.31.100.29","headers":{"Host":"1.abc.com","Charset":"UTF-8"}}""" ::
      """{"ip":"27.31.100.29","headers":{}}""" ::
      """{"ip":"27.31.100.29","headers":""}""" :: Nil)
    ```
    As empty string (the "headers") will be considered as String in the 
beginning (in line 2 and 3), it ignores the real nested data type (struct type 
"headers" in line 1), and also take the line 1 (the "headers") as String Type, 
which is not our expected.

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

    $ git pull https://github.com/chenghao-intel/spark json

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

    https://github.com/apache/spark/pull/3708.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 #3708
    
----
commit 853de511ab1f695477c15d38324a6e34fb70ef35
Author: Cheng Hao <[email protected]>
Date:   2014-12-16T01:12:22Z

    NullType instead of StringType when sampling against empty string or null 
value

----


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