MCPcopy Create free account
hub / github.com/apache/orc / buildConversion

Method buildConversion

c++/src/SchemaEvolution.cc:137–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135 }
136
137 void SchemaEvolution::buildConversion(const Type* readType, const Type* fileType) {
138 if (fileType == nullptr) {
139 throw SchemaEvolutionError("File does not have " + readType->toString());
140 }
141
142 auto [valid, convert] = checkConversion(*readType, *fileType);
143 if (!valid) {
144 invalidConversion(readType, fileType);
145 }
146 readTypeMap_.emplace(readType->getColumnId(), convert ? readType : fileType);
147
148 // check whether PPD conversion is safe
149 buildSafePPDConversionMap(readType, fileType);
150
151 for (uint64_t i = 0; i < readType->getSubtypeCount(); ++i) {
152 auto subType = readType->getSubtype(i);
153 if (subType) {
154 // null subType means that this is a sub column of map/list type
155 // and it does not exist in the file. simply skip it.
156 buildConversion(subType, fileType->getTypeByColumnId(subType->getColumnId()));
157 }
158 }
159 }
160
161 bool SchemaEvolution::needConvert(const Type& fileType) const {
162 auto _readType = getReadType(fileType);

Callers

nothing calls this directly

Calls 8

checkConversionFunction · 0.85
invalidConversionFunction · 0.85
getSubtypeCountMethod · 0.80
getSubtypeMethod · 0.80
getTypeByColumnIdMethod · 0.80
getColumnIdMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected