HyukjinKwon opened a new pull request #29283:
URL: https://github.com/apache/spark/pull/29283


   ### What changes were proposed in this pull request?
   
   This PR proposes to:
   
   1. Fix the error message when the output schema is misbatched with R 
DataFrame from the given function. For example,
   
       ```R
       df <- createDataFrame(list(list(a=1L, b="2")))
       count(gapply(df, "a", function(key, group) { group }, structType("a int, 
b int")))
       ```
   
       **Before:**
   
       ```
       Error in handleErrors(returnStatus, conn) :
         ... 
         java.lang.UnsupportedOperationException
            ...
       ```
   
       **After:**
   
       ```
       Error in handleErrors(returnStatus, conn) :
        ...
        java.lang.AssertionError: assertion failed: Invalid schema from gapply: 
expected IntegerType, IntegerType, got IntegerType, StringType
           ...
       ```
   
   2. Update documentation about the schema matching for `gapply` and `dapply`.
   
   ### Why are the changes needed?
   
   To show which schema is not matched, and let users know what's going on.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, error message is updated as above, and documentation is updated.
   
   ### How was this patch tested?
   
   Manually tested and unitttests were added.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to