-
Notifications
You must be signed in to change notification settings - Fork 0
/
relational_frame.proto
129 lines (113 loc) · 4.69 KB
/
relational_frame.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
Messages related to relational frames as used to represent the results form the relational model.
*/
syntax = "proto3";
import "org/polypheny/prism/value.proto";
option java_multiple_files = true;
option java_package = "org.polypheny.prism";
option java_outer_classname = "RelationalResult";
option go_package = "org/polypheny/prism;prism";
option csharp_namespace = "Polypheny.Prism";
package org.polypheny.prism;
/*
The RelationalFrame message encapsulates the structure of a relational frame, which includes metadata about columns and rows of data within a relational table.
This structure is essential for representing the schema and data of a table in a structured format, facilitating data manipulation and query operations.
*/
message RelationalFrame {
/*
A collection of metadata about each column in the frame.
This provides details such as index, nullability, length, precision, and type information, defining the schema of the table represented by the relational frame.
*/
repeated ColumnMeta column_meta = 1;
/*
The rows of data within the frame.
Each row consists of a series of ProtoValue objects representing the values in the row, mirroring the actual data stored in the table's rows according to the schema defined by the column metadata.
*/
repeated Row rows = 2;
}
/*
The ColumnMeta message holds metadata related to a specific column within a relational table.
*/
message ColumnMeta {
// Index of the column within the table.
int32 column_index = 1;
// Indicates whether the column can contain null values.
bool is_nullable = 2;
// The length of the column values.
int32 length = 3;
// Label associated with the column, if any.
string column_label = 4;
// Name of the column.
string column_name = 5;
// Precision of the column, usually for numerical values.
int32 precision = 6;
// Name of the entity that the column represents.
string entity_name = 7;
// Name of the schema that the column belongs to.
string schema_name = 8;
// Metadata describing the type of the column.
TypeMeta type_meta = 9;
// Scale of the column, typically for numerical values.
int32 scale = 10;
// Namespace the column resides in.
string namespace = 11;
}
/*
The FieldMeta message provides metadata for individual fields, which can be part of complex structures like arrays or structs.
*/
message FieldMeta {
// Index of the field within its containing structure.
int32 field_index = 1;
// Indicates whether the field can contain null values.
bool is_nullable = 2;
// Length of the field’s value.
int32 length = 3;
// Name of the field.
string field_name = 4;
// Precision of the field, usually for numerical values.
int32 precision = 6;
// Metadata describing the type of the field.
TypeMeta type_meta = 9;
// Scale of the field, typically for numerical values.
int32 scale = 10;
}
/*
The TypeMeta message is a comprehensive descriptor for the data types used within the system.
This message not only defines simple data types but also accommodates complex types such as structures and arrays.
Its flexibility allows it to describe a wide range of data types and data structures.
*/
message TypeMeta {
// Represents the fundamental data type of the value. This can be any basic data type depending on the definitions within ProtoValue.ProtoValueType.
ProtoPolyType proto_value_type = 1;
// If the proto_value_type indicates a structure, this field provides the metadata for that structure. Contains details about the fields within the structure. This field will be absent for non-structured types.
optional StructMeta struct_meta = 2;
// If the proto_value_type indicates an array, this field provides metadata about the type of elements within the array. This field will be absent for non-array types.
optional ArrayMeta array_meta = 3;
}
/*
The StructMeta message provides metadata specific to structured types, giving details about the fields that make up the structure.
*/
message StructMeta {
/*
A collection of metadata entries, one for each field within the structure.
Each FieldMeta provides details like the field’s name, type, nullability, etc.
*/
repeated FieldMeta field_metas = 1;
}
/*
The ArrayMeta message provides metadata about array types, detailing the kind of elements they can hold.
*/
message ArrayMeta {
/*
TypeMeta This field describes the type of elements contained within the array.
It uses the TypeMeta message, meaning an array can contain any data type, including nested arrays or structures.
*/
TypeMeta element_type = 1;
}
/*
The Row message represents a single row within a relational frame.
*/
message Row {
// The values within the row, represented as a series of ProtoValue objects.
repeated ProtoValue values = 1;
}