dremio 文件系统支持view创建&一些问题
实际上如果了解apache drill 会知道drill 是支持在本地活着分布式创建view,实际上dremio 也是可以支持的,但是
此玩法不太符合官方的设计思想,给禁用了
FileSystemPlugin check 处理
- 参考代码
public boolean createOrUpdateView(NamespaceKey tableSchemaPath,
SchemaConfig schemaConfig,
View view,
ViewOptions viewOptions) throws IOException {
// 哪怕配置了LEGACY_STORE_VIEWS_ENABLED
// 添加legacy.dremio.store.views.enabled 又会触发dremio 配置的一个check 处理
// 而且web 页面直接对于文件系统的view 存储进行了过滤,对于支持创建的只能使用系统用户$dremio$
if (!Boolean.getBoolean(DremioConfig.LEGACY_STORE_VIEWS_ENABLED)) {
throw UserException.parseError()
.message("Unable to create or update view. Filesystem views are not supported.")
.build(logger);
} else if (!getMutability().hasMutationCapability(MutationType.VIEW, schemaConfig.isSystemUser())) {
throw UserException.parseError()
.message("Unable to create or update view. Schema [%s] is immutable for this user.", tableSchemaPath.getParent())
.build(logger);
}
Path viewPath = getViewPath(tableSchemaPath.getPathComponents());
FileSystem fs = createFS(schemaConfig.getUserName());
boolean replaced = fs.exists(viewPath);
final Set<PosixFilePermission> viewPerms =
MorePosixFilePermissions.fromOctalMode(schemaConfig.getOption(ExecConstants.NEW_VIEW_DEFAULT_PERMS_KEY).getStringVal());
try (OutputStream stream = FileSystemUtils.create(fs, viewPath, viewPerms)) {
lpPersistance.getMapper().writeValue(stream, view);
}
return replaced;
}
dremio 配置check配置
- 参考代码
private void check(){
// 会基于inner 配置进行reference 的check 确保不会配置多余的配置
final Config inner = getInnerConfig();
final Config ref = reference.resolve();
// make sure types are right
inner.checkValid(ref);
// make sure we don't have any extra paths. these are typically typos.
List<String> invalidPaths = new ArrayList<>();
for(Entry<String, ConfigValue> entry : inner.entrySet()){
if (DEPRECATED_PATHS.contains(entry.getKey())) {
logger.warn("Property [{}] is deprecated. Please remove it from the conf file [dremio.conf].", entry.getKey());
continue;
}
if(!ref.hasPath(entry.getKey())){
invalidPaths.add(entry.getKey());
}
}
if(!invalidPaths.isEmpty()){
StringBuilder sb = new StringBuilder();
sb.append("Failure reading configuration file. The following properties were invalid:\n");
for(String s : invalidPaths){
sb.append("\t");
sb.append(s);
sb.append("\n");
}
throw new RuntimeException(sb.toString());
}
}
- dremio 配置的参考配置文件
位置在common/legacy/src/main/resources/dremio-reference.conf
一个include 是比较重要的,此处我们可以配置额外的信息, 这样可以确保参考配置比较多,规避check 问题
include classpath("dremio-reference-ext.conf")
paths: {
# the local path for dremio to store data.
local: "/tmp/dremio",
common/legacy/src/main/resources/dremio-reference.conf
解决方法,就是添加一个dremio-reference-ext.conf文件到dremio 的conf 运行目录下,里边包含了legacy.dremio.store.views.enabled
但是因为dremio FileSystemPlugin 对于配置的处理就是有bug,而且没有直接引入DremioConfig的实例,目前是不能直接快速的
通过配置解决的,通过options 配置是实际上是一个不错的选择
说明
目前dremio 对于分布式文件系统是不支持直接进行view 的创建了,更加标准的做法是通过space 或者支持多版本的nessie catalog 服务
如果还是希望支持,就需要自己修改文件系统插件的代码了
参考资料
https://drill.apache.org/docs/create-view/
sabot/kernel/src/main/java/com/dremio/exec/store/dfs/FileSystemPlugin.java
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2023-03-05 napi 简单使用
2023-03-05 napi 基于rust 开发nodejs addons 的框架
2022-03-05 dremio 的配置管理简单说明
2020-03-05 基于pgspider+ postgres fdw+ cube.js+hasura graphql-engine的数据分析&&展示方案
2020-03-05 cube.js 集成citus pg 扩展实现多租户的数据分析
2020-03-05 hasura graphql-engine + pgspider citus 加强hasura的大数量graphql 处理能力
2020-03-05 pgspider Citus 集成使用