You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/02/21 09:19:35 UTC

[GitHub] HeartSaVioR opened a new pull request #23854: [SPARK-22000][SQL] Use String.valueOf to assign value to String type of field in Java Bean

HeartSaVioR opened a new pull request #23854: [SPARK-22000][SQL] Use String.valueOf to assign value to String type of field in Java Bean
URL: https://github.com/apache/spark/pull/23854
 
 
   ## What changes were proposed in this pull request?
   
   When assigning value to String type of field in Java Bean, catalyst generates a code to call `.toString()` which is available for most of types but it misses primitives.
   
   Hopefully `String.valueOf()` works exactly same (which calls `toString()` on non-null parameter) and even does boxing primitive types.
   
   There're already some types which calls `valueOf` hence we could just add `String` to one of types.
   
   Credit to @srowen given using `String.valueOf()` is his idea.
   https://issues.apache.org/jira/browse/SPARK-22000?focusedCommentId=16165893&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16165893
   
   ## How was this patch tested?
   
   Added UT which query is slightly modified based on sample code in attachment on JIRA issue.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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