@@ -5,15 +5,16 @@ import ProtoBuf as PB
55using ProtoBuf: OneOf
66using ProtoBuf. EnumX: @enumx
77
8- export DateTimeType, RelationId, Var, FloatType, UInt128Type, BeTreeConfig, DateTimeValue
9- export DateValue, OrMonoid, CSVLocator, Int128Type, DecimalType, UnspecifiedType, DateType
10- export MissingType, MissingValue, CSVConfig, IntType, StringType, Int128Value, UInt128Value
11- export BooleanType, DecimalValue, BeTreeLocator, var"#Type" , Value, GNFColumn, MinMonoid
12- export SumMonoid, MaxMonoid, BeTreeInfo, Binding, EDB, Attribute, Term, CSVData, Monoid
13- export BeTreeRelation, Cast, Pragma, Atom, RelTerm, Data, Primitive, RelAtom, Abstraction
14- export Algorithm, Assign, Break, Conjunction, Constraint, Def, Disjunction, Exists, FFI
15- export FunctionalDependency, MonoidDef, MonusDef, Not, Reduce, Script, Upsert, Construct
16- export Loop, Declaration, Instruction, Formula
8+ export DateTimeType, RelationId, Var, FloatType, UInt128Type, Int32Type, Float32Type
9+ export BeTreeConfig, DateTimeValue, DateValue, OrMonoid, CSVLocator, Int128Type
10+ export DecimalType, UnspecifiedType, DateType, MissingType, MissingValue, CSVConfig
11+ export IntType, StringType, Int128Value, UInt128Value, BooleanType, DecimalValue
12+ export BeTreeLocator, var"#Type" , Value, GNFColumn, MinMonoid, SumMonoid, MaxMonoid
13+ export BeTreeInfo, Binding, EDB, Attribute, Term, CSVData, Monoid, BeTreeRelation, Cast
14+ export Pragma, Atom, RelTerm, Data, Primitive, RelAtom, Abstraction, Algorithm, Assign
15+ export Break, Conjunction, Constraint, Def, Disjunction, Exists, FFI, FunctionalDependency
16+ export MonoidDef, MonusDef, Not, Reduce, Script, Upsert, Construct, Loop, Declaration
17+ export Instruction, Formula
1718abstract type var"##Abstract#Abstraction" end
1819abstract type var"##Abstract#Not" end
1920abstract type var"##Abstract#Break" end
@@ -163,6 +164,44 @@ function PB._encoded_size(x::UInt128Type)
163164 return encoded_size
164165end
165166
167+ struct Int32Type end
168+
169+ function PB. decode (d:: PB.AbstractProtoDecoder , :: Type{<:Int32Type} , _endpos:: Int = 0 , _group:: Bool = false )
170+ while ! PB. message_done (d, _endpos, _group)
171+ field_number, wire_type = PB. decode_tag (d)
172+ Base. skip (d, wire_type)
173+ end
174+ return Int32Type ()
175+ end
176+
177+ function PB. encode (e:: PB.AbstractProtoEncoder , x:: Int32Type )
178+ initpos = position (e. io)
179+ return position (e. io) - initpos
180+ end
181+ function PB. _encoded_size (x:: Int32Type )
182+ encoded_size = 0
183+ return encoded_size
184+ end
185+
186+ struct Float32Type end
187+
188+ function PB. decode (d:: PB.AbstractProtoDecoder , :: Type{<:Float32Type} , _endpos:: Int = 0 , _group:: Bool = false )
189+ while ! PB. message_done (d, _endpos, _group)
190+ field_number, wire_type = PB. decode_tag (d)
191+ Base. skip (d, wire_type)
192+ end
193+ return Float32Type ()
194+ end
195+
196+ function PB. encode (e:: PB.AbstractProtoEncoder , x:: Float32Type )
197+ initpos = position (e. io)
198+ return position (e. io) - initpos
199+ end
200+ function PB. _encoded_size (x:: Float32Type )
201+ encoded_size = 0
202+ return encoded_size
203+ end
204+
166205struct BeTreeConfig
167206 epsilon:: Float64
168207 max_pivots:: Int64
@@ -840,14 +879,14 @@ function PB._encoded_size(x::BeTreeLocator)
840879end
841880
842881struct var"#Type"
843- var"#type" :: Union{Nothing,OneOf{<:Union{UnspecifiedType,StringType,IntType,FloatType,UInt128Type,Int128Type,DateType,DateTimeType,MissingType,DecimalType,BooleanType}}}
882+ var"#type" :: Union{Nothing,OneOf{<:Union{UnspecifiedType,StringType,IntType,FloatType,UInt128Type,Int128Type,DateType,DateTimeType,MissingType,DecimalType,BooleanType,Int32Type,Float32Type }}}
844883end
845884var"#Type" (;var"#type" = nothing ) = var"#Type" (var"#type" )
846885PB. oneof_field_types (:: Type{var"#Type"} ) = (;
847- var"#type" = (;unspecified_type= UnspecifiedType, string_type= StringType, int_type= IntType, float_type= FloatType, uint128_type= UInt128Type, int128_type= Int128Type, date_type= DateType, datetime_type= DateTimeType, missing_type= MissingType, decimal_type= DecimalType, boolean_type= BooleanType),
886+ var"#type" = (;unspecified_type= UnspecifiedType, string_type= StringType, int_type= IntType, float_type= FloatType, uint128_type= UInt128Type, int128_type= Int128Type, date_type= DateType, datetime_type= DateTimeType, missing_type= MissingType, decimal_type= DecimalType, boolean_type= BooleanType, int32_type = Int32Type, float32_type = Float32Type ),
848887)
849- PB. default_values (:: Type{var"#Type"} ) = (;unspecified_type = nothing , string_type = nothing , int_type = nothing , float_type = nothing , uint128_type = nothing , int128_type = nothing , date_type = nothing , datetime_type = nothing , missing_type = nothing , decimal_type = nothing , boolean_type = nothing )
850- PB. field_numbers (:: Type{var"#Type"} ) = (;unspecified_type = 1 , string_type = 2 , int_type = 3 , float_type = 4 , uint128_type = 5 , int128_type = 6 , date_type = 7 , datetime_type = 8 , missing_type = 9 , decimal_type = 10 , boolean_type = 11 )
888+ PB. default_values (:: Type{var"#Type"} ) = (;unspecified_type = nothing , string_type = nothing , int_type = nothing , float_type = nothing , uint128_type = nothing , int128_type = nothing , date_type = nothing , datetime_type = nothing , missing_type = nothing , decimal_type = nothing , boolean_type = nothing , int32_type = nothing , float32_type = nothing )
889+ PB. field_numbers (:: Type{var"#Type"} ) = (;unspecified_type = 1 , string_type = 2 , int_type = 3 , float_type = 4 , uint128_type = 5 , int128_type = 6 , date_type = 7 , datetime_type = 8 , missing_type = 9 , decimal_type = 10 , boolean_type = 11 , int32_type = 12 , float32_type = 13 )
851890
852891function PB. decode (d:: PB.AbstractProtoDecoder , :: Type{<:var"#Type"} , _endpos:: Int = 0 , _group:: Bool = false )
853892 var"#type" = nothing
@@ -875,6 +914,10 @@ function PB.decode(d::PB.AbstractProtoDecoder, ::Type{<:var"#Type"}, _endpos::In
875914 var"#type" = OneOf (:decimal_type , PB. decode (d, Ref{DecimalType}))
876915 elseif field_number == 11
877916 var"#type" = OneOf (:boolean_type , PB. decode (d, Ref{BooleanType}))
917+ elseif field_number == 12
918+ var"#type" = OneOf (:int32_type , PB. decode (d, Ref{Int32Type}))
919+ elseif field_number == 13
920+ var"#type" = OneOf (:float32_type , PB. decode (d, Ref{Float32Type}))
878921 else
879922 Base. skip (d, wire_type)
880923 end
@@ -907,6 +950,10 @@ function PB.encode(e::PB.AbstractProtoEncoder, x::var"#Type")
907950 PB. encode (e, 10 , x. var"#type" []:: DecimalType )
908951 elseif x. var"#type" . name === :boolean_type
909952 PB. encode (e, 11 , x. var"#type" []:: BooleanType )
953+ elseif x. var"#type" . name === :int32_type
954+ PB. encode (e, 12 , x. var"#type" []:: Int32Type )
955+ elseif x. var"#type" . name === :float32_type
956+ PB. encode (e, 13 , x. var"#type" []:: Float32Type )
910957 end
911958 return position (e. io) - initpos
912959end
@@ -935,19 +982,23 @@ function PB._encoded_size(x::var"#Type")
935982 encoded_size += PB. _encoded_size (x. var"#type" []:: DecimalType , 10 )
936983 elseif x. var"#type" . name === :boolean_type
937984 encoded_size += PB. _encoded_size (x. var"#type" []:: BooleanType , 11 )
985+ elseif x. var"#type" . name === :int32_type
986+ encoded_size += PB. _encoded_size (x. var"#type" []:: Int32Type , 12 )
987+ elseif x. var"#type" . name === :float32_type
988+ encoded_size += PB. _encoded_size (x. var"#type" []:: Float32Type , 13 )
938989 end
939990 return encoded_size
940991end
941992
942993struct Value
943- value:: Union{Nothing,OneOf{<:Union{String,Int64,Float64,UInt128Value,Int128Value,MissingValue,DateValue,DateTimeValue,DecimalValue,Bool}}}
994+ value:: Union{Nothing,OneOf{<:Union{String,Int64,Float64,UInt128Value,Int128Value,MissingValue,DateValue,DateTimeValue,DecimalValue,Bool,Int32,Float32 }}}
944995end
945996Value (;value = nothing ) = Value (value)
946997PB. oneof_field_types (:: Type{Value} ) = (;
947- value = (;string_value= String, int_value= Int64, float_value= Float64, uint128_value= UInt128Value, int128_value= Int128Value, missing_value= MissingValue, date_value= DateValue, datetime_value= DateTimeValue, decimal_value= DecimalValue, boolean_value= Bool),
998+ value = (;string_value= String, int_value= Int64, float_value= Float64, uint128_value= UInt128Value, int128_value= Int128Value, missing_value= MissingValue, date_value= DateValue, datetime_value= DateTimeValue, decimal_value= DecimalValue, boolean_value= Bool, int32_value = Int32, float32_value = Float32 ),
948999)
949- PB. default_values (:: Type{Value} ) = (;string_value = " " , int_value = zero (Int64), float_value = zero (Float64), uint128_value = nothing , int128_value = nothing , missing_value = nothing , date_value = nothing , datetime_value = nothing , decimal_value = nothing , boolean_value = false )
950- PB. field_numbers (:: Type{Value} ) = (;string_value = 1 , int_value = 2 , float_value = 3 , uint128_value = 4 , int128_value = 5 , missing_value = 6 , date_value = 7 , datetime_value = 8 , decimal_value = 9 , boolean_value = 10 )
1000+ PB. default_values (:: Type{Value} ) = (;string_value = " " , int_value = zero (Int64), float_value = zero (Float64), uint128_value = nothing , int128_value = nothing , missing_value = nothing , date_value = nothing , datetime_value = nothing , decimal_value = nothing , boolean_value = false , int32_value = zero (Int32), float32_value = zero (Float32) )
1001+ PB. field_numbers (:: Type{Value} ) = (;string_value = 1 , int_value = 2 , float_value = 3 , uint128_value = 4 , int128_value = 5 , missing_value = 6 , date_value = 7 , datetime_value = 8 , decimal_value = 9 , boolean_value = 10 , int32_value = 11 , float32_value = 12 )
9511002
9521003function PB. decode (d:: PB.AbstractProtoDecoder , :: Type{<:Value} , _endpos:: Int = 0 , _group:: Bool = false )
9531004 value = nothing
@@ -973,6 +1024,10 @@ function PB.decode(d::PB.AbstractProtoDecoder, ::Type{<:Value}, _endpos::Int=0,
9731024 value = OneOf (:decimal_value , PB. decode (d, Ref{DecimalValue}))
9741025 elseif field_number == 10
9751026 value = OneOf (:boolean_value , PB. decode (d, Bool))
1027+ elseif field_number == 11
1028+ value = OneOf (:int32_value , PB. decode (d, Int32))
1029+ elseif field_number == 12
1030+ value = OneOf (:float32_value , PB. decode (d, Float32))
9761031 else
9771032 Base. skip (d, wire_type)
9781033 end
@@ -1003,6 +1058,10 @@ function PB.encode(e::PB.AbstractProtoEncoder, x::Value)
10031058 PB. encode (e, 9 , x. value[]:: DecimalValue )
10041059 elseif x. value. name === :boolean_value
10051060 PB. encode (e, 10 , x. value[]:: Bool )
1061+ elseif x. value. name === :int32_value
1062+ PB. encode (e, 11 , x. value[]:: Int32 )
1063+ elseif x. value. name === :float32_value
1064+ PB. encode (e, 12 , x. value[]:: Float32 )
10061065 end
10071066 return position (e. io) - initpos
10081067end
@@ -1029,6 +1088,10 @@ function PB._encoded_size(x::Value)
10291088 encoded_size += PB. _encoded_size (x. value[]:: DecimalValue , 9 )
10301089 elseif x. value. name === :boolean_value
10311090 encoded_size += PB. _encoded_size (x. value[]:: Bool , 10 )
1091+ elseif x. value. name === :int32_value
1092+ encoded_size += PB. _encoded_size (x. value[]:: Int32 , 11 )
1093+ elseif x. value. name === :float32_value
1094+ encoded_size += PB. _encoded_size (x. value[]:: Float32 , 12 )
10321095 end
10331096 return encoded_size
10341097end
0 commit comments