Browse Source

!4029 CSV dataset's rows counting adapts the eof of Euler OS

Merge pull request !4029 from jiangzhiwen/dataset/adapt_eof_fix
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
57fd31b221
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.cc
  2. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.h

+ 2
- 2
mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.cc View File

@@ -168,7 +168,7 @@ int CsvOp::CsvParser::end_file(char c) {
return 0;
}

int CsvOp::CsvParser::countRows(char c) {
int CsvOp::CsvParser::countRows(int c) {
Message m;
if (c == '"') {
m = Message::MS_QUOTE;
@@ -701,7 +701,7 @@ int64_t CsvOp::CountTotalRows(const std::string &file) {
}
csv_parser.Reset();
while (ifs.good()) {
char chr = ifs.get();
int chr = ifs.get();
if (csv_parser.countRows(chr) != 0) {
break;
}


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.h View File

@@ -105,7 +105,7 @@ class CsvOp : public ParallelOp {
return it->second.second(*this, c);
}

int countRows(char c);
int countRows(int c);

Status initCsvParser();



Loading…
Cancel
Save