HyukjinKwon commented on code in PR #38462:
URL: https://github.com/apache/spark/pull/38462#discussion_r1013928764


##########
python/pyspark/sql/connect/column.py:
##########
@@ -99,11 +101,59 @@ def to_plan(self, session: Optional["RemoteSparkSession"]) 
-> "proto.Expression"
         value_type = type(self._value)
         exp = proto.Expression()
         if value_type is int:
-            exp.literal.i32 = cast(int, self._value)
+            exp.literal.i64 = cast(int, self._value)
+        elif value_type is bool:
+            exp.literal.boolean = cast(bool, self._value)
         elif value_type is str:
             exp.literal.string = cast(str, self._value)
         elif value_type is float:
             exp.literal.fp64 = cast(float, self._value)
+        elif value_type is decimal.Decimal:
+            d_v = cast(decimal.Decimal, self._value)
+            v_tuple = d_v.as_tuple()
+            exp.literal.decimal.scale = abs(v_tuple.exponent)
+            exp.literal.decimal.precision = len(v_tuple.digits) - 
abs(v_tuple.exponent)
+            # Two complement yeah...
+            raise ValueError("Python Decimal not supported.")

Review Comment:
   Can we remove if this is not implemented yet?



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