message: Add a addField interface for NebulaSchemaProvider
diff: @@ -84,6 +84,11 @@ std::shared_ptr<const SchemaProviderIf> FileBasedSchemaManager::readSchema(
  folly::StringPiece fname = folly::trimWhitespace(parts[0]);
  folly::StringPiece type = folly::trimWhitespace(parts[1]);
  + if (schema->getFieldIndex(fname) != -1) {
  + LOG(ERROR) << "Field \"" << fname.toString() << "\" has existed";
  + return std::shared_ptr<SchemaProviderIf>();
  + }
  +
  if (fname == "__version") {
  try {
  schema->ver_ = folly::to<SchemaVer>(type);
  @@ -126,11 +131,7 @@ std::shared_ptr<const SchemaProviderIf> FileBasedSchemaManager::readSchema(
  return std::shared_ptr<SchemaProviderIf>();
  }
  - schema->fields_.push_back(
  - std::make_shared<NebulaSchemaProvider::SchemaField>(fname.toString(),
  - std::move(vtype)));
  - schema->fieldNameIndex_.emplace(fname.toString(),
  - static_cast<int64_t>(schema->fields_.size() - 1));
  + schema->addField(fname, std::move(vtype));
  }
  }
  