feat: add type extension for column (#122)

* feat: decimal128 proto

* chore: make all

* chore: empty line

* refactor: remove precision and scale

* chore: cr comment

Co-authored-by: Yingwen <realevenyag@gmail.com>

---------

Co-authored-by: Yingwen <realevenyag@gmail.com>
This commit is contained in:
Wei
2023-11-24 10:40:50 +08:00
committed by GitHub
parent 2ffdcae9f9
commit a11efce55d
20 changed files with 6320 additions and 494 deletions
+4
View File
@@ -61,6 +61,7 @@ message Column {
repeated int64 duration_millisecond_values = 28;
repeated int64 duration_microsecond_values = 29;
repeated int64 duration_nanosecond_values = 30;
repeated Decimal128 decimal128_values = 31;
}
// The array of non-null values in this column.
//
@@ -80,4 +81,7 @@ message Column {
// Helpful in creating vector from column.
ColumnDataType datatype = 5;
// Extension for ColumnDataType.
ColumnDataTypeExtension datatype_extension = 6;
}
+19
View File
@@ -97,6 +97,7 @@ enum ColumnDataType {
DURATION_MILLISECOND = 27;
DURATION_MICROSECOND = 28;
DURATION_NANOSECOND = 29;
DECIMAL128 = 30;
}
message IntervalMonthDayNano {
@@ -104,3 +105,21 @@ message IntervalMonthDayNano {
int32 days = 2;
int64 nanoseconds = 3;
}
// (hi: high 64 bits, lo: low 64 bits) are used to keep the decimal128 value.
message Decimal128 {
int64 hi = 1;
int64 lo = 2;
}
// Type extension for some complex types
message ColumnDataTypeExtension {
oneof type_ext {
DecimalTypeExtension decimal_type = 1;
}
}
message DecimalTypeExtension {
int32 precision = 1;
int32 scale = 2;
}
+2
View File
@@ -103,6 +103,8 @@ message ColumnDef {
bytes default_constraint = 4;
SemanticType semantic_type = 5;
string comment = 6;
// Extension for ColumnDataType.
ColumnDataTypeExtension datatype_extension = 7;
}
message AddColumnLocation {
+3
View File
@@ -31,6 +31,8 @@ message ColumnSchema {
string column_name = 1;
ColumnDataType datatype = 2;
SemanticType semantic_type = 3;
// Extension for ColumnDataType.
ColumnDataTypeExtension datatype_extension = 4;
}
message Row { repeated Value values = 1; }
@@ -71,5 +73,6 @@ message Value {
int64 duration_millisecond_value = 28;
int64 duration_microsecond_value = 29;
int64 duration_nanosecond_value = 30;
Decimal128 decimal128_value = 31;
}
}