提交 57fd31b2 编写于 作者: M mindspore-ci-bot 提交者: Gitee

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

Merge pull request !4029 from jiangzhiwen/dataset/adapt_eof_fix
...@@ -168,7 +168,7 @@ int CsvOp::CsvParser::end_file(char c) { ...@@ -168,7 +168,7 @@ int CsvOp::CsvParser::end_file(char c) {
return 0; return 0;
} }
int CsvOp::CsvParser::countRows(char c) { int CsvOp::CsvParser::countRows(int c) {
Message m; Message m;
if (c == '"') { if (c == '"') {
m = Message::MS_QUOTE; m = Message::MS_QUOTE;
...@@ -701,7 +701,7 @@ int64_t CsvOp::CountTotalRows(const std::string &file) { ...@@ -701,7 +701,7 @@ int64_t CsvOp::CountTotalRows(const std::string &file) {
} }
csv_parser.Reset(); csv_parser.Reset();
while (ifs.good()) { while (ifs.good()) {
char chr = ifs.get(); int chr = ifs.get();
if (csv_parser.countRows(chr) != 0) { if (csv_parser.countRows(chr) != 0) {
break; break;
} }
......
...@@ -105,7 +105,7 @@ class CsvOp : public ParallelOp { ...@@ -105,7 +105,7 @@ class CsvOp : public ParallelOp {
return it->second.second(*this, c); return it->second.second(*this, c);
} }
int countRows(char c); int countRows(int c);
Status initCsvParser(); Status initCsvParser();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册