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/10/13 18:39:23 UTC

[GitHub] [spark] amaliujia commented on a diff in pull request #38227: [SPARK-40774][CONNECT] Add Sample to proto and Connect DSL

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


##########
connector/connect/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -71,6 +72,15 @@ class SparkConnectPlanner(plan: proto.Relation, session: SparkSession) {
     session.sessionState.sqlParser.parsePlan(sql.getQuery)
   }
 
+  private def transformSample(rel: proto.Sample): LogicalPlan = {
+    Sample(

Review Comment:
   We cannot. This is proto and for those primitive type there is no `set/unset`: they have default values.
   
   For example, int32 if it is not set then the default value is 0. Server side does not know if this is set or not set, and 0 is a valid input.
   
   The only solution I can think of is that we wrap each of the primitive type field into a message. However that complicate the proto and I am afraid that we don't want to go to that path. 



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