MCPcopy Create free account
hub / github.com/ByConity/ByConity / hasColumnFiles

Method hasColumnFiles

src/Storages/MergeTree/MergeTreeDataPartCompact.cpp:196–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196bool MergeTreeDataPartCompact::hasColumnFiles(const NameAndTypePair & column) const
197{
198 if (!getColumnPosition(column.name))
199 return false;
200
201 /// Handle the special case that there has only one compact map column because it will has no data file if just insert {}
202 if (hasOnlyOneCompactedMapColumnNotKV())
203 return true;
204
205 auto check_stream_exists = [&](const String & bin_file, const String & mrk_file)
206 {
207 auto checksums = getChecksums();
208 auto bin_checksum = checksums->files.find(bin_file);
209 auto mrk_checksum = checksums->files.find(mrk_file);
210
211 return bin_checksum != checksums->files.end() && mrk_checksum != checksums->files.end();
212 };
213
214 if (column.type->isByteMap())
215 {
216 for (auto & [file, _] : getChecksums()->files)
217 {
218 if (isMapImplicitFileNameOfSpecialMapName(file, column.name))
219 return true;
220 }
221 return false;
222 }
223 else
224 return check_stream_exists(DATA_FILE_NAME_WITH_EXTENSION, DATA_FILE_NAME + index_granularity_info.marks_file_extension);
225}
226
227void MergeTreeDataPartCompact::setColumnsPtr(const NamesAndTypesListPtr & new_columns_ptr)
228{

Callers

nothing calls this directly

Calls 4

findMethod · 0.45
endMethod · 0.45
isByteMapMethod · 0.45

Tested by

no test coverage detected