File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed
Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class Batch {
1111
1212 Batch (Schema schema) : schema_(std::move(schema)) {
1313 columns_.reserve (schema_.FieldsCount ());
14- for (auto & field : schema_.GetFields ()) {
14+ for (auto & field : schema_.GetFields ()) {
1515 columns_.emplace_back (MakeColumn (field.type , field.nullable ));
1616 }
1717 }
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ class BoolColumn : public Column {
6666 if (nullable_) {
6767 AppendBit (is_null_, true );
6868 }
69+ ++size_;
6970 }
7071
7172 std::unique_ptr<Column> CloneEmpty () const override {
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ class CSVRowReader {
8181 in_quotes = true ;
8282 was_quoted = true ;
8383 } else if (c == ' \n ' ) {
84- row.emplace_back (std::move (field), was_quoted);
84+ row.emplace_back (Field{ std::move (field), was_quoted} );
8585 return row;
8686 } else {
8787 field += c;
@@ -90,7 +90,10 @@ class CSVRowReader {
9090 }
9191
9292 if (!field.empty () || !row.empty ()) {
93- row.emplace_back (std::move (field), was_quoted);
93+ if (in_quotes) {
94+ THROW_RUNTIME_ERROR (" Got EOF inside the quotes" );
95+ }
96+ row.emplace_back (Field{std::move (field), was_quoted});
9497 return row;
9598 }
9699 return std::nullopt ;
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ class SchemaManager {
4141 }
4242
4343 static void WriteToStream (std::ostream& os, const core::Schema& schema) {
44- for (auto & field : schema.GetFields ()) {
44+ for (const auto & field : schema.GetFields ()) {
4545 os << field.name << " ," << core::DataTypeToString (field.type );
4646 if (field.nullable ) {
4747 os << " ,nullable" ;
You can’t perform that action at this time.
0 commit comments