Skip to content

Commit dcbb5d7

Browse files
committed
Reorder csv config options for clarity
1 parent fc74c56 commit dcbb5d7

5 files changed

Lines changed: 52 additions & 50 deletions

File tree

proto/relationalai/lqp/v1/transactions.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,13 @@ message Snapshot {
8282

8383
message ExportCSVConfig {
8484
string path = 1;
85-
repeated ExportCSVColumn data_columns = 2;
8685

8786
ExportCSVSource csv_source = 10;
8887
CSVConfig csv_config = 11;
8988

9089
// Below are all deprecated in favour of the `csv_config` above.
90+
repeated ExportCSVColumn data_columns = 2;
91+
9192
optional int64 partition_size = 3;
9293
optional string compression = 4;
9394
optional bool syntax_header_row = 5;

sdks/go/src/lqp/v1/transactions.pb.go

Lines changed: 35 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdks/julia/LogicalQueryProtocol.jl/src/gen/relationalai/lqp/v1/transactions_pb.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,9 @@ end
557557

558558
struct ExportCSVConfig
559559
path::String
560-
data_columns::Vector{ExportCSVColumn}
561560
csv_source::Union{Nothing,ExportCSVSource}
562561
csv_config::Union{Nothing,CSVConfig}
562+
data_columns::Vector{ExportCSVColumn}
563563
partition_size::Int64
564564
compression::String
565565
syntax_header_row::Bool
@@ -568,15 +568,15 @@ struct ExportCSVConfig
568568
syntax_quotechar::String
569569
syntax_escapechar::String
570570
end
571-
ExportCSVConfig(;path = "", data_columns = Vector{ExportCSVColumn}(), csv_source = nothing, csv_config = nothing, partition_size = zero(Int64), compression = "", syntax_header_row = false, syntax_missing_string = "", syntax_delim = "", syntax_quotechar = "", syntax_escapechar = "") = ExportCSVConfig(path, data_columns, csv_source, csv_config, partition_size, compression, syntax_header_row, syntax_missing_string, syntax_delim, syntax_quotechar, syntax_escapechar)
572-
PB.default_values(::Type{ExportCSVConfig}) = (;path = "", data_columns = Vector{ExportCSVColumn}(), csv_source = nothing, csv_config = nothing, partition_size = zero(Int64), compression = "", syntax_header_row = false, syntax_missing_string = "", syntax_delim = "", syntax_quotechar = "", syntax_escapechar = "")
573-
PB.field_numbers(::Type{ExportCSVConfig}) = (;path = 1, data_columns = 2, csv_source = 10, csv_config = 11, partition_size = 3, compression = 4, syntax_header_row = 5, syntax_missing_string = 6, syntax_delim = 7, syntax_quotechar = 8, syntax_escapechar = 9)
571+
ExportCSVConfig(;path = "", csv_source = nothing, csv_config = nothing, data_columns = Vector{ExportCSVColumn}(), partition_size = zero(Int64), compression = "", syntax_header_row = false, syntax_missing_string = "", syntax_delim = "", syntax_quotechar = "", syntax_escapechar = "") = ExportCSVConfig(path, csv_source, csv_config, data_columns, partition_size, compression, syntax_header_row, syntax_missing_string, syntax_delim, syntax_quotechar, syntax_escapechar)
572+
PB.default_values(::Type{ExportCSVConfig}) = (;path = "", csv_source = nothing, csv_config = nothing, data_columns = Vector{ExportCSVColumn}(), partition_size = zero(Int64), compression = "", syntax_header_row = false, syntax_missing_string = "", syntax_delim = "", syntax_quotechar = "", syntax_escapechar = "")
573+
PB.field_numbers(::Type{ExportCSVConfig}) = (;path = 1, csv_source = 10, csv_config = 11, data_columns = 2, partition_size = 3, compression = 4, syntax_header_row = 5, syntax_missing_string = 6, syntax_delim = 7, syntax_quotechar = 8, syntax_escapechar = 9)
574574

575575
function PB.decode(d::PB.AbstractProtoDecoder, ::Type{<:ExportCSVConfig})
576576
path = ""
577-
data_columns = PB.BufferedVector{ExportCSVColumn}()
578577
csv_source = Ref{Union{Nothing,ExportCSVSource}}(nothing)
579578
csv_config = Ref{Union{Nothing,CSVConfig}}(nothing)
579+
data_columns = PB.BufferedVector{ExportCSVColumn}()
580580
partition_size = zero(Int64)
581581
compression = ""
582582
syntax_header_row = false
@@ -588,12 +588,12 @@ function PB.decode(d::PB.AbstractProtoDecoder, ::Type{<:ExportCSVConfig})
588588
field_number, wire_type = PB.decode_tag(d)
589589
if field_number == 1
590590
path = PB.decode(d, String)
591-
elseif field_number == 2
592-
PB.decode!(d, data_columns)
593591
elseif field_number == 10
594592
PB.decode!(d, csv_source)
595593
elseif field_number == 11
596594
PB.decode!(d, csv_config)
595+
elseif field_number == 2
596+
PB.decode!(d, data_columns)
597597
elseif field_number == 3
598598
partition_size = PB.decode(d, Int64)
599599
elseif field_number == 4
@@ -612,15 +612,15 @@ function PB.decode(d::PB.AbstractProtoDecoder, ::Type{<:ExportCSVConfig})
612612
Base.skip(d, wire_type)
613613
end
614614
end
615-
return ExportCSVConfig(path, data_columns[], csv_source[], csv_config[], partition_size, compression, syntax_header_row, syntax_missing_string, syntax_delim, syntax_quotechar, syntax_escapechar)
615+
return ExportCSVConfig(path, csv_source[], csv_config[], data_columns[], partition_size, compression, syntax_header_row, syntax_missing_string, syntax_delim, syntax_quotechar, syntax_escapechar)
616616
end
617617

618618
function PB.encode(e::PB.AbstractProtoEncoder, x::ExportCSVConfig)
619619
initpos = position(e.io)
620620
!isempty(x.path) && PB.encode(e, 1, x.path)
621-
!isempty(x.data_columns) && PB.encode(e, 2, x.data_columns)
622621
!isnothing(x.csv_source) && PB.encode(e, 10, x.csv_source)
623622
!isnothing(x.csv_config) && PB.encode(e, 11, x.csv_config)
623+
!isempty(x.data_columns) && PB.encode(e, 2, x.data_columns)
624624
x.partition_size != zero(Int64) && PB.encode(e, 3, x.partition_size)
625625
!isempty(x.compression) && PB.encode(e, 4, x.compression)
626626
x.syntax_header_row != false && PB.encode(e, 5, x.syntax_header_row)
@@ -633,9 +633,9 @@ end
633633
function PB._encoded_size(x::ExportCSVConfig)
634634
encoded_size = 0
635635
!isempty(x.path) && (encoded_size += PB._encoded_size(x.path, 1))
636-
!isempty(x.data_columns) && (encoded_size += PB._encoded_size(x.data_columns, 2))
637636
!isnothing(x.csv_source) && (encoded_size += PB._encoded_size(x.csv_source, 10))
638637
!isnothing(x.csv_config) && (encoded_size += PB._encoded_size(x.csv_config, 11))
638+
!isempty(x.data_columns) && (encoded_size += PB._encoded_size(x.data_columns, 2))
639639
x.partition_size != zero(Int64) && (encoded_size += PB._encoded_size(x.partition_size, 3))
640640
!isempty(x.compression) && (encoded_size += PB._encoded_size(x.compression, 4))
641641
x.syntax_header_row != false && (encoded_size += PB._encoded_size(x.syntax_header_row, 5))

0 commit comments

Comments
 (0)