包装一个cube.js dremio 的驱动
因为默认cube.js dremio 查询1s 延迟的问题,进行了调整(参考了bigquery driver 的模式)
项目代码说明
- 代码结构
├── README.md
├── driver
│ ├── DremioDriver.js
│ ├── DremioQuery.js
│ └── index.js
├── package.json
└── yarn.lock
- pacakge.json
{
"name": "@dalongrong/mydremio-driver",
"description": "Cube.js dremio database driver",
"author": "rongfengliang",
"version": "1.0.4",
"public": true,
"repository": {
"type": "git",
"url": "https://github.com/rongfengliang/cubejs-dremio-driver"
},
"engines": {
"node": ">=10.8.0"
},
"main": "driver/index.js",
"dependencies": {
"@cubejs-backend/query-orchestrator": "^0.26.81",
"@cubejs-backend/schema-compiler": "^0.26.81",
"@cubejs-backend/shared": "^0.26.81",
"axios": "^0.21.1",
"moment-timezone": "^0.5.33",
"sqlstring": "^2.3.2"
},
"license": "Apache-2.0",
"devDependencies": {
"@cubejs-backend/linter": "^0.26.74"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"p": "yarn publish --access public"
}
}
- 代码说明
具体可以参考github
使用说明
因为cube.js 目前处理数据driver 方言的问题,需要自己配置下,参考
// Cube.js configuration options: https://cube.dev/docs/config
const {DremioDriver,DremioQuery} = require("@dalongrong/mydremio-driver")
module.exports = {
dialectFactory: (dataSource) => {
// need config datasource for multitenant env
return DremioQuery
},
queryTransformer: (query, { securityContext }) => {
console.log(securityContext)
return query;
},
dbType: ({ dataSource } = {}) => {
return "mydremio"
},
driverFactory: ({ dataSource } = {}) => {
return new DremioDriver({})
}
};
说明
关于cube.js 集成dremio驱动的修改已经pr了,但是官方暂时还没有合并,如果需要提高查询速度的可以基于此进行扩展,npm包已经发布了
可以直接使用@dalongrong/mydremio-driver
参考资料
https://github.com/rongfengliang/cubejs-dremio-driver
https://github.com/cube-js/cube.js/pull/2475
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2020-04-08 alpine-glibc docker镜像
2020-04-08 几个添加外部js文件到react 的方法
2019-04-08 使用fpm 软件包打包
2019-04-08 使用golang 编写postgresql 扩展
2018-04-08 elixir 使用mix umbrella 模块化项目
2014-04-08 web 分享代码片段
2014-04-08 Microsoft OWIN