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/11/25 10:25:09 UTC

[GitHub] [spark] zhengruifeng commented on a diff in pull request #38800: [SPARK-41264][CONNECT][PYTHON][WIP] Make Literal support more datatypes

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


##########
connector/connect/src/main/protobuf/spark/connect/expressions.proto:
##########
@@ -40,36 +40,37 @@ message Expression {
 
   message Literal {
     oneof literal_type {
-      bool boolean = 1;
-      int32 i8 = 2;
-      int32 i16 = 3;
-      int32 i32 = 5;
-      int64 i64 = 7;
-      float fp32 = 10;
-      double fp64 = 11;
-      string string = 12;
-      bytes binary = 13;
-      // Timestamp in units of microseconds since the UNIX epoch.
-      int64 timestamp = 14;
+      bool null = 1;
+      bytes binary = 2;
+      bool boolean = 3;
+
+      int32 byte = 4;
+      int32 short = 5;
+      int32 integer = 6;
+      int64 long = 7;
+      float float = 10;
+      double double = 11;
+      Decimal decimal = 12;
+
+      string string = 13;
+
       // Date in units of days since the UNIX epoch.
       int32 date = 16;
-      // Time in units of microseconds past midnight
-      int64 time = 17;

Review Comment:
   yes, I don't find a corresponding sql type for `datetime.time`, so remove it.



##########
connector/connect/src/main/protobuf/spark/connect/expressions.proto:
##########
@@ -83,29 +84,20 @@ 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;
       // The maximum number of digits allowed in the value.
       // the maximum precision is 38.
-      int32 precision = 2;
+      optional int32 precision = 2;
       // declared scale of decimal literal
-      int32 scale = 3;
+      optional int32 scale = 3;
     }
 
-    message Map {
-      message KeyValue {
-        Literal key = 1;
-        Literal value = 2;
-      }
-
-      repeated KeyValue key_values = 1;
+    message CalendarInterval {
+      int32 months = 1;
+      int32 days = 2;
+      int64 microseconds = 3;
     }
 
     message IntervalYearToMonth {

Review Comment:
   will update



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