itholic commented on code in PR #41511:
URL: https://github.com/apache/spark/pull/41511#discussion_r1222760105


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -1686,6 +1692,11 @@ class SparkConnectPlanner(val session: SparkSession) {
     case other => throw InvalidPlanInput(s"$field should be a literal boolean, 
but got $other")
   }
 
+  private def extractInteger(expr: Expression, field: String): Int = expr 
match {
+    case Literal(int: Int, IntegerType) => int
+    case other => throw InvalidPlanInput(s"$field should be a literal integer, 
but got $other")

Review Comment:
   Btw, maybe in the future we should also convert these kind of errors into 
error class. Let's leave it as it is for now since they're not user-facing.



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