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


##########
connector/connect/src/main/protobuf/spark/connect/expressions.proto:
##########
@@ -83,59 +80,39 @@ message Expression {
     // directly declare the type variation).
     uint32 type_variation_reference = 51;
 
-    message VarChar {
-      string value = 1;
-      uint32 length = 2;
-    }
-
     message Decimal {
-      // little-endian twos-complement integer representation of complete value
-      // (ignoring precision) Always 16 bytes in length
-      bytes value = 1;
+      // the string representation.
+      string value = 1;

Review Comment:
   refer to the constructors of Decimal 
https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala#L541-L564
   
   I think we can use :
   ```
     def apply(unscaled: Long, precision: Int, scale: Int): Decimal =
       new Decimal().set(unscaled, precision, scale)
   
     def apply(value: String): Decimal = new Decimal().set(BigDecimal(value))
   ```
   
   I just choose `string` for two reasons:
   1,  it is convenient;
   2, not sure about how to get the `unscaled` and `scale`  from python 
`decimal`



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