bool PropertyGroup::IsValidated()

in cpp/src/graphar/graph_info.cc [116:143]


bool PropertyGroup::IsValidated() const {
  if (prefix_.empty() ||
      (file_type_ != FileType::CSV && file_type_ != FileType::PARQUET &&
       file_type_ != FileType::ORC)) {
    return false;
  }
  if (properties_.empty()) {
    return false;
  }
  std::unordered_set<std::string> check_property_unique_set;
  for (const auto& p : properties_) {
    if (p.name.empty() || p.type == nullptr) {
      return false;
    }
    if (check_property_unique_set.find(p.name) !=
        check_property_unique_set.end()) {
      return false;
    } else {
      check_property_unique_set.insert(p.name);
    }
    // TODO(@acezen): support list type in csv file
    if (p.type->id() == Type::LIST && file_type_ == FileType::CSV) {
      // list type is not supported in csv file
      return false;
    }
  }
  return true;
}