cloud-fan commented on code in PR #45989:
URL: https://github.com/apache/spark/pull/45989#discussion_r1565128648


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/variant/VariantExpressionEvalUtils.scala:
##########
@@ -41,4 +43,69 @@ object VariantExpressionEvalUtils {
           input.toString, BadRecordException(() => input, cause = e))
     }
   }
+
+  /** Cast a Spark value from `dataType` into the variant type. */
+  def castToVariant(input: Any, dataType: DataType): VariantVal = {

Review Comment:
   shall we add overload methods for some primitive types like int, long, 
double to reduce boxing overhead?



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

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to