Skip to content

Commit

Permalink
Add GetValidateLevel & Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lixueclaire committed Apr 17, 2023
1 parent 9b7f7f1 commit c7e7038
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions cpp/include/gar/writer/arrow_chunk_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,13 @@ class EdgeChunkWriter {
validate_level_ = validate_level;
}

/**
* @brief Get the validate level.
*
* @return The validate level of this writer.
*/
inline ValidateLevel GetValidateLevel() const { return validate_level_; }

/**
* @brief Check if the writer operation for offset is allowed.
*
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/arrow_chunk_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ Status VertexPropertyWriter::Validate(
if (validate_level == ValidateLevel::default_validate)
validate_level = validate_level_;
// no validate
if (validate_level_ == ValidateLevel::no_validate)
if (validate_level == ValidateLevel::no_validate)
return Status::OK();
// weak validate
if (input_table->num_rows() > vertex_info_.GetChunkSize())
return Status::OutOfRange();
if (!vertex_info_.ContainPropertyGroup(property_group))
return Status::Invalid("invalid property group");
return Status::InvalidOperation("invalid property group");
if (chunk_index < 0)
return Status::Invalid("invalid chunk index");
return Status::InvalidOperation("invalid chunk index");
// strong validate
if (validate_level == ValidateLevel::strong_validate) {
auto schema = input_table->schema();
Expand Down

0 comments on commit c7e7038

Please sign in to comment.