dremio sys.job_results.<jobid> 内部处理简单说明

dremio 支持一种基于select * from sys.job_results.<jobid> 格式的job result 查询,实际上不是物理表,而是vds,以下是一些简单说明

参考请求图

如下,可以看出,对于上边格式的sql 查询使用的是SysFlightStoragePlugin 存储插件的处理,上获取的数view,实际对应的是__jobResultsStore 存储插件中的数据信息

SysFlightStoragePlugin getView 处理

参考代码

// 可以看出SysFlightStoragePlugin 包装返回一个view ,实际是jobresult 的表信息
public ViewTable getView(List<String> tableSchemaPath, SchemaConfig schemaConfig) {
    if (systemIcebergTablesStoragePlugin != null && systemIcebergTablesStoragePlugin.get().isSupportedTablePath(tableSchemaPath)) {
      return systemIcebergTablesStoragePlugin.get().getViewTable(tableSchemaPath, schemaConfig.getUserName());
    }
    if (!JobResultInfoProvider.isJobResultsTable(tableSchemaPath)) {
      return null;
    }
 
    final String jobId = Iterables.getLast(tableSchemaPath);
    final Optional<JobResultInfoProvider.JobResultInfo> jobResultInfo =
      jobResultInfoProvider.getJobResultInfo(jobId, schemaConfig.getUserName());
 
    return jobResultInfo.map(info -> {
      final View view = Views.fieldTypesToView(jobId, getJobResultsQuery(info.getResultDatasetPath()),
        ViewFieldsHelper.getBatchSchemaFields(info.getBatchSchema()), null);
 
      return new ViewTable(new NamespaceKey(tableSchemaPath), view, CatalogUser.from(SystemUser.SYSTEM_USERNAME), info.getBatchSchema());
    }).orElse(null);
}

说明

一般文件存储插件对于getView 返回的数据都为null (除过开启legacy.dremio.store.views.enabled),SysFlightStoragePlugin 存储插件,自己包装了viewtable

参考资料

plugins/sysflight/src/main/java/com/dremio/plugins/sysflight/SysFlightPluginConf.java
plugins/sysflight/src/main/java/com/dremio/plugins/sysflight/SysFlightStoragePlugin.java
sabot/kernel/src/main/java/com/dremio/exec/catalog/DatasetManager.java
sabot/kernel/src/main/java/com/dremio/exec/store/Views.java
sabot/kernel/src/main/java/com/dremio/exec/planner/logical/ViewTable.java

posted on   荣锋亮  阅读(23)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2022-03-08 krakend 2.0.0 发布了
2022-03-08 dremio ConnectionConf 接口说明
2022-03-08 dremio SourceMetadataManager 服务简单说明
2020-03-08 pgspider Citu 副本以及节点移除简单学习
2020-03-08 Citus 官方docker demo 中membership-manager原理简单说明
2020-03-08 pgspider Citus docker 镜像使用
2019-03-08 nginx unit 1.8 支持基于java servlet 的开发模型

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示