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
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)
239
+
std::pair<DataInputDescriptor*, int> DataInputDescriptor::navigateToLevel(int counter, int numTF, int wantedParentLevel, std::string_view wantedOrigin)
238
240
{
241
+
if (!setFile(counter, wantedParentLevel, wantedOrigin)) {
242
+
return {nullptr, -1};
243
+
}
244
+
auto folderName = fmt::format("DF_{}", mfilenames[counter]->listOfTimeFrameNumbers[numTF]);
245
+
auto parentFile = getParentFile(counter, numTF, "", wantedParentLevel, wantedOrigin);
int wantedLevel = mContext.levelForOrigin(wantedOrigin);
475
+
476
+
// If this origin is mapped to a parent level deeper than current, skip directly without
477
+
// attempting to read from this level.
478
+
if (wantedLevel != -1 && mLevel < wantedLevel) {
479
+
auto [parentFile, parentNumTF] = navigateToLevel(counter, numTF, wantedLevel, wantedOrigin);
480
+
if (parentFile == nullptr) {
481
+
auto rootFS = std::dynamic_pointer_cast<TFileFileSystem>(mCurrentFilesystem);
482
+
throwstd::runtime_error(fmt::format(R"(No parent file found for "{}" while looking for level {} in "{}")", treename, wantedLevel, rootFS->GetFile()->GetName()));
483
+
}
484
+
if (parentNumTF == -1) {
485
+
auto parentRootFS = std::dynamic_pointer_cast<TFileFileSystem>(parentFile->mCurrentFilesystem);
486
+
throwstd::runtime_error(fmt::format(R"(DF not found in parent file "{}")", parentRootFS->GetFile()->GetName()));
results.push_back(ConfigParamSpec{"aod-parent-access-level", VariantType::String, value, {"Allow parent file access up to specified level. Default: no (0)"}});
170
170
}
171
+
if (key == "aod-origin-level-mapping") {
172
+
results.push_back(ConfigParamSpec{"aod-origin-level-mapping", VariantType::String, value, {"Map origin to parent level for AOD reading. Syntax: ORIGIN:LEVEL[,ORIGIN2:LEVEL2,...]. E.g. \"DYN:1\"."}});
0 commit comments