diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.cc index c7f36e9d760..0871b3f30cd 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.cc @@ -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::STRING, "")); + } + } return Status::OK(); } } // namespace dataset