forked from OSSInnovation/mindspore
!4029 CSV dataset's rows counting adapts the eof of Euler OS
Merge pull request !4029 from jiangzhiwen/dataset/adapt_eof_fix
This commit is contained in:
commit
57fd31b221
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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…
Reference in New Issue