Skip to content

Commit

Permalink
Simplify serialization by removing redundant PrimitiveScalarValue
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Sep 25, 2022
1 parent b30172d commit ecf9925
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 367 deletions.
42 changes: 4 additions & 38 deletions datafusion/proto/proto/datafusion.proto
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,9 @@ message StructValue {

message ScalarValue{
oneof value {
// Null value of any type (type is encoded)
PrimitiveScalarType null_value = 19;
// was PrimitiveScalarType null_value = 19;
// Null value of any type
ArrowType null_value = 33;

bool bool_value = 1;
string utf8_value = 2;
Expand All @@ -768,7 +769,7 @@ message ScalarValue{
uint64 uint64_value = 11;
float float32_value = 12;
double float64_value = 13;
//Literal Date32 value always has a unit of day
// Literal Date32 value always has a unit of day
int32 date_32_value = 14;
ScalarListValue list_value = 17;
//WAS: ScalarType null_list_value = 18;
Expand All @@ -793,41 +794,6 @@ message Decimal128{
int64 s = 3;
}

// Contains all valid datafusion scalar type except for
// List
enum PrimitiveScalarType{

BOOL = 0; // arrow::Type::BOOL
UINT8 = 1; // arrow::Type::UINT8
INT8 = 2; // arrow::Type::INT8
UINT16 = 3; // represents arrow::Type fields in src/arrow/type.h
INT16 = 4;
UINT32 = 5;
INT32 = 6;
UINT64 = 7;
INT64 = 8;
FLOAT32 = 9;
FLOAT64 = 10;
UTF8 = 11;
LARGE_UTF8 = 12;
DATE32 = 13;
TIMESTAMP_MICROSECOND = 14;
TIMESTAMP_NANOSECOND = 15;
NULL = 16;
DECIMAL128 = 17;
DATE64 = 20;
TIMESTAMP_SECOND = 21;
TIMESTAMP_MILLISECOND = 22;
INTERVAL_YEARMONTH = 23;
INTERVAL_DAYTIME = 24;
INTERVAL_MONTHDAYNANO = 28;

BINARY = 25;
LARGE_BINARY = 26;

TIME64 = 27;
}


// Broke out into multiple message types so that type
// metadata did not need to be in separate message
Expand Down
Loading

0 comments on commit ecf9925

Please sign in to comment.