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/22 14:09:04 UTC

[GitHub] HeartSaVioR commented on a change in pull request #23854: [SPARK-22000][SQL] Inject necessary casts when data type of columns and matching type of fields are not equal

HeartSaVioR commented on a change in pull request #23854: [SPARK-22000][SQL] Inject necessary casts when data type of columns and matching type of fields are not equal
URL: https://github.com/apache/spark/pull/23854#discussion_r259351000
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala
 ##########
 @@ -235,9 +236,6 @@ object JavaTypeInference {
           path :: Nil,
           returnNullable = false)
 
-      case c if c == classOf[java.lang.String] =>
-        Invoke(path, "toString", ObjectType(classOf[String]))
 
 Review comment:
   > AFAIK the `path` should be a string type column
   
   The sample code tried to bind IntegerType column to String field in Java bean, which looks to break your expectation. (I guess ScalaReflection would not encounter this case.) 
   
   Spark doesn't throw error for this case - actually Spark would show undefined behaviors, compilation failures on generated code, even might be possible to throw runtime exception.

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