init column_default_list_ when it is empty

This commit is contained in:
jiangzhiwen 2020-07-23 16:59:04 +08:00
parent 859fe6bc41
commit 3bed1ef967
1 changed files with 5 additions and 0 deletions

View File

@ -758,6 +758,11 @@ Status CsvOp::ComputeColMap() {
} else {
MS_LOG(WARNING) << "Column name map is already set!";
}
if (column_default_list_.size() < column_name_id_map_.size()) {
for (int32_t i = column_default_list_.size(); i < column_name_id_map_.size(); i++) {
column_default_list_.push_back(std::make_shared<CsvOp::Record<std::string>>(CsvOp::STRING, ""));
}
}
return Status::OK();
}
} // namespace dataset