GitHub user patrickmcgloin opened a pull request:

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

    [SPARK-24682] [SQL] from_json / to_json now handle java.sql.Date/Timestamp 
as Map key

    ## What changes were proposed in this pull request?
    
    When generating JSON the key is not just converted to a String now, instead 
the type is checked and for Dates and Timestamps the formatting happens first 
(if provided). When reading JSON, if the Schema says that a Map has a Date or 
Timestamp as the key then once again the formatting is done before the String 
is converted to the correct value for a Date or Timestamp.
    
    ## How was this patch tested?
    
    I have added Unit Tests.
    
    Please review http://spark.apache.org/contributing.html before opening a 
pull request.


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

    $ git pull https://github.com/patrickmcgloin/spark DATES_IN_MAPS

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

    https://github.com/apache/spark/pull/21671.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 #21671
    
----
commit 58576fabf7b3ba93c177c78356bb17492e8b3d80
Author: Patrick McGloin <mcgloin.patrick@...>
Date:   2018-03-30T14:09:25Z

    SPARK-23565: Improved error message for when the number of sources for a 
query changes

commit 7e88efab0c1479c1bf1e2df42906873ed2f5e050
Author: Patrick McGloin <mcgloin.patrick@...>
Date:   2018-04-25T16:51:09Z

    Only one space after the period / dot

commit b35acf543cc0af66a56081457c53ab450b4cdcdb
Author: Patrick McGloin <mcgloin.patrick@...>
Date:   2018-04-25T16:52:57Z

    Removed UNT as not needed for logging change

commit 0d5ae1f70ad7d99079b84219f5a2da99ab1ff6fd
Author: Patrick McGloin <mcgloin.patrick@...>
Date:   2018-06-27T17:51:39Z

    Merge remote-tracking branch 'upstream/master'

commit 9686807a9fc729de0b63f68395f3a9e688fb087f
Author: Patrick McGloin <mcgloin.patrick@...>
Date:   2018-06-29T14:41:30Z

    Allow Dates and Timestamps to be keys in JSON Maps

----


---

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

Reply via email to