zhengruifeng commented on code in PR #39016:
URL: https://github.com/apache/spark/pull/39016#discussion_r1045163077


##########
python/pyspark/sql/connect/column.py:
##########
@@ -180,7 +186,12 @@ def to_plan(self, session: "SparkConnectClient") -> 
"proto.Expression":
         elif isinstance(self._value, bool):
             expr.literal.boolean = bool(self._value)
         elif isinstance(self._value, int):
-            expr.literal.long = int(self._value)
+            if JVM_INT_MIN <= self._value <= JVM_INT_MAX:

Review Comment:
   I think the conversion [happens 
here](https://github.com/py4j/py4j/blob/master/py4j-java/src/main/java/py4j/Protocol.java#L281-L316)
   
   It seems py4j doesn't deal with `Byte` and `Short`
   
   If there is an expression only accept a ByteType, then I think it will be 
the same problem.
   
   also cc @HyukjinKwon @xinrong-meng who knows py4j better then me.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to