@@ -36,7 +36,7 @@ void TS3BufferRaw::ColumnsOrder(const TVector<ui32>& tags) {
36
36
}
37
37
}
38
38
39
- void TS3BufferRaw::Collect (const NTable::IScan::TRow& row, IOutputStream& out) {
39
+ bool TS3BufferRaw::Collect (const NTable::IScan::TRow& row, IOutputStream& out) {
40
40
bool needsComma = false ;
41
41
for (const auto & [tag, column] : Columns) {
42
42
auto it = Indices.find (tag);
@@ -57,18 +57,19 @@ void TS3BufferRaw::Collect(const NTable::IScan::TRow& row, IOutputStream& out) {
57
57
continue ;
58
58
}
59
59
60
+ bool serialized = true ;
60
61
switch (column.Type .GetTypeId ()) {
61
62
case NScheme::NTypeIds::Int32:
62
- out << cell.AsValue <i32>();
63
+ serialized = cell.ToStream <i32>(out, ErrorString );
63
64
break ;
64
65
case NScheme::NTypeIds::Uint32:
65
- out << cell.AsValue <ui32>();
66
+ serialized = cell.ToStream <ui32>(out, ErrorString );
66
67
break ;
67
68
case NScheme::NTypeIds::Int64:
68
- out << cell.AsValue <i64>();
69
+ serialized = cell.ToStream <i64>(out, ErrorString );
69
70
break ;
70
71
case NScheme::NTypeIds::Uint64:
71
- out << cell.AsValue <ui64>();
72
+ serialized = cell.ToStream <ui64>(out, ErrorString );
72
73
break ;
73
74
case NScheme::NTypeIds::Uint8:
74
75
// case NScheme::NTypeIds::Byte:
@@ -78,19 +79,19 @@ void TS3BufferRaw::Collect(const NTable::IScan::TRow& row, IOutputStream& out) {
78
79
out << static_cast <i32>(cell.AsValue <i8>());
79
80
break ;
80
81
case NScheme::NTypeIds::Int16:
81
- out << cell.AsValue <i16>();
82
+ serialized = cell.ToStream <i16>(out, ErrorString );
82
83
break ;
83
84
case NScheme::NTypeIds::Uint16:
84
- out << cell.AsValue <ui16>();
85
+ serialized = cell.ToStream <ui16>(out, ErrorString );
85
86
break ;
86
87
case NScheme::NTypeIds::Bool:
87
- out << cell.AsValue <bool >();
88
+ serialized = cell.ToStream <bool >(out, ErrorString );
88
89
break ;
89
90
case NScheme::NTypeIds::Double:
90
- out << cell.AsValue <double >();
91
+ serialized = cell.ToStream <double >(out, ErrorString );
91
92
break ;
92
93
case NScheme::NTypeIds::Float:
93
- out << cell.AsValue <float >();
94
+ serialized = cell.ToStream <float >(out, ErrorString );
94
95
break ;
95
96
case NScheme::NTypeIds::Date:
96
97
out << TInstant::Days (cell.AsValue <ui16>());
@@ -102,13 +103,13 @@ void TS3BufferRaw::Collect(const NTable::IScan::TRow& row, IOutputStream& out) {
102
103
out << TInstant::MicroSeconds (cell.AsValue <ui64>());
103
104
break ;
104
105
case NScheme::NTypeIds::Interval:
105
- out << cell.AsValue <i64>();
106
+ serialized = cell.ToStream <i64>(out, ErrorString );
106
107
break ;
107
108
case NScheme::NTypeIds::Decimal:
108
- out << DecimalToString (cell.AsValue <std::pair<ui64, i64>>());
109
+ serialized = DecimalToStream (cell.AsValue <std::pair<ui64, i64>>(), out, ErrorString );
109
110
break ;
110
111
case NScheme::NTypeIds::DyNumber:
111
- out << DyNumberToString (cell.AsBuf ());
112
+ serialized = DyNumberToStream (cell.AsBuf (), out, ErrorString );
112
113
break ;
113
114
case NScheme::NTypeIds::String:
114
115
case NScheme::NTypeIds::String4k:
@@ -127,16 +128,22 @@ void TS3BufferRaw::Collect(const NTable::IScan::TRow& row, IOutputStream& out) {
127
128
default :
128
129
Y_ABORT (" Unsupported type" );
129
130
}
131
+
132
+ if (!serialized) {
133
+ return false ;
134
+ }
130
135
}
131
136
132
137
out << " \n " ;
133
138
++Rows;
139
+
140
+ return true ;
134
141
}
135
142
136
143
bool TS3BufferRaw::Collect (const NTable::IScan::TRow& row) {
137
144
TBufferOutput out (Buffer);
138
- Collect (row, out );
139
- return true ;
145
+ ErrorString. clear ( );
146
+ return Collect (row, out) ;
140
147
}
141
148
142
149
IEventBase* TS3BufferRaw::PrepareEvent (bool last, NExportScan::IBuffer::TStats& stats) {
@@ -161,7 +168,7 @@ bool TS3BufferRaw::IsFilled() const {
161
168
}
162
169
163
170
TString TS3BufferRaw::GetError () const {
164
- Y_ABORT ( " unreachable " ) ;
171
+ return ErrorString ;
165
172
}
166
173
167
174
TMaybe<TBuffer> TS3BufferRaw::Flush (bool ) {
0 commit comments