MCPcopy Create free account
hub / github.com/apache/impala / IsTidy

Method IsTidy

be/src/exec/json/json-parser.cc:61–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60template <class Scanner>
61bool JsonParser<Scanner>::IsTidy() {
62 // Check if there are no unclosed arrays or objects.
63 bool no_unclosed_elements = array_depth_ == 0 && object_depth_ == 0;
64
65 // Check if there are no field or row in handling.
66 bool no_handling_field_or_row = current_field_idx_ == -1 && !row_initialized_;
67
68 // Check if there are no any fields found, i.e. all false in 'field_found_'.
69 bool no_fields_found = field_found_.size() == 0 ||
70 (field_found_[0] == false &&
71 !memcmp(field_found_.data(), field_found_.data() + 1, field_found_.size() - 1));
72
73 // Return true if all conditions are met, indicating that the parser is tidy
74 return no_unclosed_elements && no_handling_field_or_row && no_fields_found;
75}
76
77template <class Scanner>
78bool JsonParser<Scanner>::MoveToNextJson() {

Callers 2

ParseWrapperMethod · 0.80
ScanMethod · 0.80

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected