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 2022/12/07 21:09:55 UTC

[GitHub] [spark] amaliujia commented on a diff in pull request #38970: [SPARK-41412][CONNECT] Implement `Column.cast`

amaliujia commented on code in PR #38970:
URL: https://github.com/apache/spark/pull/38970#discussion_r1042684374


##########
connector/connect/common/src/main/protobuf/spark/connect/expressions.proto:
##########
@@ -43,7 +43,11 @@ message Expression {
     Expression expr = 1;
 
     // (Required) the data type that the expr to be casted to.
-    DataType cast_to_type = 2;
+    oneof cast_to_type {
+      DataType type = 2;
+      // If this is set, Server will use Catalyst parser to parse this string to DataType.
+      string type_str = 3;

Review Comment:
   I add this to follow the design principle so far that we should move repeated clients implementation to the server side to reduce client side redundant work.
   
   Otherwise client side will need to implement `string` to `DataType` conversion and each client will need to the same thing.



-- 
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-unsubscribe@spark.apache.org

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


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