@@ -126,11 +126,13 @@ VertexPropertyWriter::VertexPropertyWriter(
126126Status VertexPropertyWriter::validate (const IdType& count,
127127 ValidateLevel validate_level) const {
128128 // use the writer's validate level
129- if (validate_level == ValidateLevel::default_validate)
129+ if (validate_level == ValidateLevel::default_validate) {
130130 validate_level = validate_level_;
131+ }
131132 // no validate
132- if (validate_level == ValidateLevel::no_validate)
133+ if (validate_level == ValidateLevel::no_validate) {
133134 return Status::OK ();
135+ }
134136 // weak & strong validate
135137 if (count < 0 ) {
136138 return Status::Invalid (" The number of vertices is negative." );
@@ -143,11 +145,13 @@ Status VertexPropertyWriter::validate(
143145 const std::shared_ptr<PropertyGroup>& property_group, IdType chunk_index,
144146 ValidateLevel validate_level) const {
145147 // use the writer's validate level
146- if (validate_level == ValidateLevel::default_validate)
148+ if (validate_level == ValidateLevel::default_validate) {
147149 validate_level = validate_level_;
150+ }
148151 // no validate
149- if (validate_level == ValidateLevel::no_validate)
152+ if (validate_level == ValidateLevel::no_validate) {
150153 return Status::OK ();
154+ }
151155 // weak & strong validate
152156 if (!vertex_info_->HasPropertyGroup (property_group)) {
153157 return Status::KeyError (" The property group" , " does not exist in " ,
@@ -512,11 +516,13 @@ EdgeChunkWriter::EdgeChunkWriter(const std::shared_ptr<EdgeInfo>& edge_info,
512516Status EdgeChunkWriter::validate (IdType count_or_index1, IdType count_or_index2,
513517 ValidateLevel validate_level) const {
514518 // use the writer's validate level
515- if (validate_level == ValidateLevel::default_validate)
519+ if (validate_level == ValidateLevel::default_validate) {
516520 validate_level = validate_level_;
521+ }
517522 // no validate
518- if (validate_level == ValidateLevel::no_validate)
523+ if (validate_level == ValidateLevel::no_validate) {
519524 return Status::OK ();
525+ }
520526 // weak & strong validate for adj list type
521527 if (!edge_info_->HasAdjacentListType (adj_list_type_)) {
522528 return Status::KeyError (
@@ -538,11 +544,13 @@ Status EdgeChunkWriter::validate(
538544 IdType vertex_chunk_index, IdType chunk_index,
539545 ValidateLevel validate_level) const {
540546 // use the writer's validate level
541- if (validate_level == ValidateLevel::default_validate)
547+ if (validate_level == ValidateLevel::default_validate) {
542548 validate_level = validate_level_;
549+ }
543550 // no validate
544- if (validate_level == ValidateLevel::no_validate)
551+ if (validate_level == ValidateLevel::no_validate) {
545552 return Status::OK ();
553+ }
546554 // validate for adj list type & index
547555 GAR_RETURN_NOT_OK (validate (vertex_chunk_index, chunk_index, validate_level));
548556 // weak & strong validate for property group
@@ -558,11 +566,13 @@ Status EdgeChunkWriter::validate(
558566 const std::shared_ptr<arrow::Table>& input_table, IdType vertex_chunk_index,
559567 ValidateLevel validate_level) const {
560568 // use the writer's validate level
561- if (validate_level == ValidateLevel::default_validate)
569+ if (validate_level == ValidateLevel::default_validate) {
562570 validate_level = validate_level_;
571+ }
563572 // no validate
564- if (validate_level == ValidateLevel::no_validate)
573+ if (validate_level == ValidateLevel::no_validate) {
565574 return Status::OK ();
575+ }
566576 // validate for adj list type & index
567577 GAR_RETURN_NOT_OK (validate (vertex_chunk_index, 0 , validate_level));
568578 // weak validate for the input table
@@ -613,11 +623,13 @@ Status EdgeChunkWriter::validate(
613623 const std::shared_ptr<arrow::Table>& input_table, IdType vertex_chunk_index,
614624 IdType chunk_index, ValidateLevel validate_level) const {
615625 // use the writer's validate level
616- if (validate_level == ValidateLevel::default_validate)
626+ if (validate_level == ValidateLevel::default_validate) {
617627 validate_level = validate_level_;
628+ }
618629 // no validate
619- if (validate_level == ValidateLevel::no_validate)
630+ if (validate_level == ValidateLevel::no_validate) {
620631 return Status::OK ();
632+ }
621633 // validate for adj list type & index
622634 GAR_RETURN_NOT_OK (validate (vertex_chunk_index, chunk_index, validate_level));
623635 // weak validate for the input table
@@ -666,11 +678,13 @@ Status EdgeChunkWriter::validate(
666678 IdType vertex_chunk_index, IdType chunk_index,
667679 ValidateLevel validate_level) const {
668680 // use the writer's validate level
669- if (validate_level == ValidateLevel::default_validate)
681+ if (validate_level == ValidateLevel::default_validate) {
670682 validate_level = validate_level_;
683+ }
671684 // no validate
672- if (validate_level == ValidateLevel::no_validate)
685+ if (validate_level == ValidateLevel::no_validate) {
673686 return Status::OK ();
687+ }
674688 // validate for property group, adj list type & index
675689 GAR_RETURN_NOT_OK (validate (property_group, vertex_chunk_index, chunk_index,
676690 validate_level));
@@ -970,12 +984,14 @@ Result<std::shared_ptr<arrow::Table>> EdgeChunkWriter::getOffsetTable(
970984 int64_t global_index = 0 ;
971985 for (IdType i = begin_index; i < end_index; i++) {
972986 while (true ) {
973- if (array_index >= column->num_chunks ())
987+ if (array_index >= column->num_chunks ()) {
974988 break ;
989+ }
975990 if (index >= ids->length ()) {
976991 array_index++;
977- if (array_index == column->num_chunks ())
992+ if (array_index == column->num_chunks ()) {
978993 break ;
994+ }
979995 ids = std::static_pointer_cast<arrow::Int64Array>(
980996 column->chunk (array_index));
981997 index = 0 ;
0 commit comments