MCPcopy Create free account
hub / github.com/apache/arrow / ComputeLevelInfo

Function ComputeLevelInfo

cpp/src/parquet/level_conversion.h:125–140  ·  view source on GitHub ↗

Calculates and returns LevelInfo for a column descriptor.

Source from the content-addressed store, hash-verified

123
124 // Calculates and returns LevelInfo for a column descriptor.
125 static LevelInfo ComputeLevelInfo(const ColumnDescriptor* descr) {
126 LevelInfo level_info;
127 level_info.def_level = descr->max_definition_level();
128 level_info.rep_level = descr->max_repetition_level();
129
130 int16_t min_spaced_def_level = descr->max_definition_level();
131 const ::parquet::schema::Node* node = descr->schema_node().get();
132 while (node && !node->is_repeated()) {
133 if (node->is_optional()) {
134 min_spaced_def_level--;
135 }
136 node = node->parent();
137 }
138 level_info.repeated_ancestor_def_level = min_spaced_def_level;
139 return level_info;
140 }
141
142 friend std::ostream& operator<<(std::ostream& os, const LevelInfo& levels) {
143 // This print method is to silence valgrind issues. What's printed

Callers 2

RecordReaderMethod · 0.70
ColumnWriterImplMethod · 0.70

Calls 2

getMethod · 0.45
parentMethod · 0.45

Tested by

no test coverage detected