You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6ada843
Browse filesBrowse the repository at this point in the historyBrowse files
DPL: allow determining the origin from user provide input
In order to support embedding, we need allow the user to provide
a mapping between the desired origin and the level in the parent file
chain where the table should be found.
arrow::dataset::FileSource DataInputDescriptor::getFileFolder(int counter, int numTF, std::string_view origin)
251
+
std::pair<DataInputDescriptor*, int> DataInputDescriptor::navigateToLevel(int counter, int numTF, int wantedParentLevel, std::string_view wantedOrigin)
252
+
{
253
+
if (!setFile(counter, wantedParentLevel, wantedOrigin)) {
254
+
return {nullptr, -1};
255
+
}
256
+
auto folderName = fmt::format("DF_{}", mfilenames[counter]->listOfTimeFrameNumbers[numTF]);
257
+
auto parentFile = getParentFile(counter, numTF, "", wantedParentLevel, wantedOrigin);
int wantedLevel = mContext.levelForOrigin(wantedOrigin);
491
+
492
+
// If this origin is mapped to a parent level deeper than current, skip directly without
493
+
// attempting to read from this level.
494
+
if (wantedLevel != -1 && mLevel < wantedLevel) {
495
+
auto [parentFile, parentNumTF] = navigateToLevel(counter, numTF, wantedLevel, wantedOrigin);
496
+
if (parentFile == nullptr) {
497
+
auto rootFS = std::dynamic_pointer_cast<TFileFileSystem>(mCurrentFilesystem);
498
+
throwstd::runtime_error(fmt::format(R"(No parent file found for "{}" while looking for level {} in "{}")", treename, wantedLevel, rootFS->GetFile()->GetName()));
499
+
}
500
+
if (parentNumTF == -1) {
501
+
auto parentRootFS = std::dynamic_pointer_cast<TFileFileSystem>(parentFile->mCurrentFilesystem);
502
+
throwstd::runtime_error(fmt::format(R"(DF not found in parent file "{}")", parentRootFS->GetFile()->GetName()));
0 commit comments