@@ -7,8 +7,8 @@ using ProtoBuf.EnumX: @enumx
77
88export ExportIcebergConfig, ExportCSVColumn, Demand, Undefine, MaintenanceLevel, Define
99export Context, Sync, SnapshotMapping, Abort, Output, ExportCSVColumns, IVMConfig, Snapshot
10- export ExportCSVSource, Configure, Write, ExportCSVConfig, Export, Epoch, Read, Transaction
11- export WhatIf
10+ export ExportCSVSource, Configure, Write, ExportCSVOutput, ExportCSVConfig, ExportOutput
11+ export Export, Epoch, Read, Transaction, WhatIf
1212abstract type var"##Abstract#Transaction" end
1313abstract type var"##Abstract#Epoch" end
1414abstract type var"##Abstract#Read" end
@@ -629,6 +629,43 @@ function PB._encoded_size(x::Write)
629629 return encoded_size
630630end
631631
632+ struct ExportCSVOutput
633+ csv_source:: Union{Nothing,ExportCSVSource}
634+ csv_config:: Union{Nothing,CSVConfig}
635+ end
636+ ExportCSVOutput (;csv_source = nothing , csv_config = nothing ) = ExportCSVOutput (csv_source, csv_config)
637+ PB. default_values (:: Type{ExportCSVOutput} ) = (;csv_source = nothing , csv_config = nothing )
638+ PB. field_numbers (:: Type{ExportCSVOutput} ) = (;csv_source = 1 , csv_config = 2 )
639+
640+ function PB. decode (d:: PB.AbstractProtoDecoder , :: Type{<:ExportCSVOutput} , _endpos:: Int = 0 , _group:: Bool = false )
641+ csv_source = Ref {Union{Nothing,ExportCSVSource}} (nothing )
642+ csv_config = Ref {Union{Nothing,CSVConfig}} (nothing )
643+ while ! PB. message_done (d, _endpos, _group)
644+ field_number, wire_type = PB. decode_tag (d)
645+ if field_number == 1
646+ PB. decode! (d, csv_source)
647+ elseif field_number == 2
648+ PB. decode! (d, csv_config)
649+ else
650+ Base. skip (d, wire_type)
651+ end
652+ end
653+ return ExportCSVOutput (csv_source[], csv_config[])
654+ end
655+
656+ function PB. encode (e:: PB.AbstractProtoEncoder , x:: ExportCSVOutput )
657+ initpos = position (e. io)
658+ ! isnothing (x. csv_source) && PB. encode (e, 1 , x. csv_source)
659+ ! isnothing (x. csv_config) && PB. encode (e, 2 , x. csv_config)
660+ return position (e. io) - initpos
661+ end
662+ function PB. _encoded_size (x:: ExportCSVOutput )
663+ encoded_size = 0
664+ ! isnothing (x. csv_source) && (encoded_size += PB. _encoded_size (x. csv_source, 1 ))
665+ ! isnothing (x. csv_config) && (encoded_size += PB. _encoded_size (x. csv_config, 2 ))
666+ return encoded_size
667+ end
668+
632669struct ExportCSVConfig
633670 path:: String
634671 csv_source:: Union{Nothing,ExportCSVSource}
@@ -720,6 +757,46 @@ function PB._encoded_size(x::ExportCSVConfig)
720757 return encoded_size
721758end
722759
760+ struct ExportOutput
761+ export_output:: Union{Nothing,OneOf{ExportCSVOutput}}
762+ end
763+ ExportOutput (;export_output = nothing ) = ExportOutput (export_output)
764+ PB. oneof_field_types (:: Type{ExportOutput} ) = (;
765+ export_output = (;csv= ExportCSVOutput),
766+ )
767+ PB. default_values (:: Type{ExportOutput} ) = (;csv = nothing )
768+ PB. field_numbers (:: Type{ExportOutput} ) = (;csv = 1 )
769+
770+ function PB. decode (d:: PB.AbstractProtoDecoder , :: Type{<:ExportOutput} , _endpos:: Int = 0 , _group:: Bool = false )
771+ export_output = nothing
772+ while ! PB. message_done (d, _endpos, _group)
773+ field_number, wire_type = PB. decode_tag (d)
774+ if field_number == 1
775+ export_output = OneOf (:csv , PB. decode (d, Ref{ExportCSVOutput}))
776+ else
777+ Base. skip (d, wire_type)
778+ end
779+ end
780+ return ExportOutput (export_output)
781+ end
782+
783+ function PB. encode (e:: PB.AbstractProtoEncoder , x:: ExportOutput )
784+ initpos = position (e. io)
785+ if isnothing (x. export_output);
786+ elseif x. export_output. name === :csv
787+ PB. encode (e, 1 , x. export_output[]:: ExportCSVOutput )
788+ end
789+ return position (e. io) - initpos
790+ end
791+ function PB. _encoded_size (x:: ExportOutput )
792+ encoded_size = 0
793+ if isnothing (x. export_output);
794+ elseif x. export_output. name === :csv
795+ encoded_size += PB. _encoded_size (x. export_output[]:: ExportCSVOutput , 1 )
796+ end
797+ return encoded_size
798+ end
799+
723800struct Export
724801 export_config:: Union{Nothing,OneOf{<:Union{ExportCSVConfig,ExportIcebergConfig}}}
725802end
@@ -773,7 +850,7 @@ struct var"##Stub#Epoch"{T1<:var"##Abstract#Read"} <: var"##Abstract#Epoch"
773850end
774851
775852struct var"##Stub#Read" {T1<: var"##Abstract#WhatIf" } <: var"##Abstract#Read"
776- read_type:: Union{Nothing,OneOf{<:Union{Demand,Output,T1,Abort,Export}}}
853+ read_type:: Union{Nothing,OneOf{<:Union{Demand,Output,T1,Abort,Export,ExportOutput }}}
777854end
778855
779856struct var"##Stub#Transaction" {T1<: var"##Abstract#WhatIf" } <: var"##Abstract#Transaction"
@@ -824,10 +901,10 @@ end
824901const Read = var"##Stub#Read" {var"##Stub#WhatIf" }
825902Read (;read_type = nothing ) = Read (read_type)
826903PB. oneof_field_types (:: Type{Read} ) = (;
827- read_type = (;demand= Demand, output= Output, what_if= WhatIf, abort= Abort, var"#export" = Export),
904+ read_type = (;demand= Demand, output= Output, what_if= WhatIf, abort= Abort, var"#export" = Export, export_output = ExportOutput ),
828905)
829- PB. default_values (:: Type{Read} ) = (;demand = nothing , output = nothing , what_if = nothing , abort = nothing , var"#export" = nothing )
830- PB. field_numbers (:: Type{Read} ) = (;demand = 1 , output = 2 , what_if = 3 , abort = 4 , var"#export" = 5 )
906+ PB. default_values (:: Type{Read} ) = (;demand = nothing , output = nothing , what_if = nothing , abort = nothing , var"#export" = nothing , export_output = nothing )
907+ PB. field_numbers (:: Type{Read} ) = (;demand = 1 , output = 2 , what_if = 3 , abort = 4 , var"#export" = 5 , export_output = 6 )
831908
832909function PB. decode (d:: PB.AbstractProtoDecoder , :: Type{<:Read} , _endpos:: Int = 0 , _group:: Bool = false )
833910 read_type = nothing
@@ -843,6 +920,8 @@ function PB.decode(d::PB.AbstractProtoDecoder, ::Type{<:Read}, _endpos::Int=0, _
843920 read_type = OneOf (:abort , PB. decode (d, Ref{Abort}))
844921 elseif field_number == 5
845922 read_type = OneOf (:var"#export" , PB. decode (d, Ref{Export}))
923+ elseif field_number == 6
924+ read_type = OneOf (:export_output , PB. decode (d, Ref{ExportOutput}))
846925 else
847926 Base. skip (d, wire_type)
848927 end
@@ -863,6 +942,8 @@ function PB.encode(e::PB.AbstractProtoEncoder, x::Read)
863942 PB. encode (e, 4 , x. read_type[]:: Abort )
864943 elseif x. read_type. name === :var"#export"
865944 PB. encode (e, 5 , x. read_type[]:: Export )
945+ elseif x. read_type. name === :export_output
946+ PB. encode (e, 6 , x. read_type[]:: ExportOutput )
866947 end
867948 return position (e. io) - initpos
868949end
@@ -879,6 +960,8 @@ function PB._encoded_size(x::Read)
879960 encoded_size += PB. _encoded_size (x. read_type[]:: Abort , 4 )
880961 elseif x. read_type. name === :var"#export"
881962 encoded_size += PB. _encoded_size (x. read_type[]:: Export , 5 )
963+ elseif x. read_type. name === :export_output
964+ encoded_size += PB. _encoded_size (x. read_type[]:: ExportOutput , 6 )
882965 end
883966 return encoded_size
884967end
0 commit comments