feat: add struct and list data type (#277)
* feat: add struct and list data type * type extensions * feat: extend column type * chore: rename fields * add value enum item * feat: add value * refactor: item->items * feat: use single ListValue/StructValue for Row and Column
This commit is contained in:
@@ -17,6 +17,7 @@ syntax = "proto3";
|
||||
package greptime.v1;
|
||||
|
||||
import "greptime/v1/common.proto";
|
||||
import "greptime/v1/row.proto";
|
||||
|
||||
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
|
||||
option java_outer_classname = "Columns";
|
||||
@@ -58,7 +59,11 @@ message Column {
|
||||
repeated int64 interval_day_time_values = 25;
|
||||
repeated IntervalMonthDayNano interval_month_day_nano_values = 26;
|
||||
repeated Decimal128 decimal128_values = 31;
|
||||
|
||||
repeated ListValue list_values = 40;
|
||||
repeated StructValue struct_values = 41;
|
||||
}
|
||||
|
||||
// The array of non-null values in this column.
|
||||
//
|
||||
// For example: suppose there is a column "foo" that contains some int32
|
||||
|
||||
@@ -151,6 +151,8 @@ enum ColumnDataType {
|
||||
DECIMAL128 = 30;
|
||||
JSON = 31;
|
||||
VECTOR = 32;
|
||||
LIST = 40;
|
||||
STRUCT = 41;
|
||||
}
|
||||
|
||||
message IntervalMonthDayNano {
|
||||
@@ -185,6 +187,12 @@ message Decimal128 {
|
||||
int64 lo = 2;
|
||||
}
|
||||
|
||||
message StructField {
|
||||
string name = 1;
|
||||
ColumnDataType datatype = 2;
|
||||
ColumnDataTypeExtension datatype_extension = 3;
|
||||
}
|
||||
|
||||
// Type extension for some complex types
|
||||
message ColumnDataTypeExtension {
|
||||
oneof type_ext {
|
||||
@@ -192,6 +200,8 @@ message ColumnDataTypeExtension {
|
||||
// Marks the binary column in proto is actually a JSON column.
|
||||
JsonTypeExtension json_type = 2;
|
||||
VectorTypeExtension vector_type = 3;
|
||||
ListTypeExtension list_type = 4;
|
||||
StructTypeExtension struct_type = 5;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,6 +218,15 @@ message VectorTypeExtension {
|
||||
uint32 dim = 1;
|
||||
}
|
||||
|
||||
message ListTypeExtension {
|
||||
ColumnDataType datatype = 1;
|
||||
ColumnDataTypeExtension datatype_extension = 2;
|
||||
}
|
||||
|
||||
message StructTypeExtension {
|
||||
repeated StructField fields = 1;
|
||||
}
|
||||
|
||||
// Additional options for the column.
|
||||
message ColumnOptions {
|
||||
// Supported keys:
|
||||
|
||||
@@ -76,5 +76,16 @@ message Value {
|
||||
int64 interval_day_time_value = 25;
|
||||
IntervalMonthDayNano interval_month_day_nano_value = 26;
|
||||
Decimal128 decimal128_value = 31;
|
||||
|
||||
ListValue list_value = 40;
|
||||
StructValue struct_value = 41;
|
||||
}
|
||||
}
|
||||
|
||||
message ListValue {
|
||||
repeated Value items = 1;
|
||||
}
|
||||
|
||||
message StructValue {
|
||||
repeated Value items = 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user