cube.js trino driver 使用几个问题

因为目前集成的实际上就是官方推荐的一个presto node client,但是因为node client 的一些问题(查询状态监测基于循环,所以不是很好)
以下是一个解决方法

禁用timezone

这个需要修改cube.js trino 的驱动,很简单(具体参考源码)

constructor(compilers, options){
    // diable timezone 
     delete options.timezone
     super(compilers,options)
  } 

查询默认800ms 的延迟

这个实际上是可以控制的,比如我们调整为50ms,比较合理的方式时间基于线性补偿的机制(可以参考cube.js dremio以及biguquery的驱动 ),后期调整
配置延迟时间
cube.js

 
const {PrestoDriver,PrestodbQuery} = require("@dalongrong/trino-driver") // 注意驱动使用1.0.1 版本
module.exports = {
    dialectFactory: (dataSource) => {
        // need config  datasource  for multitenant env
        return PrestodbQuery
    },
    dbType: ({ dataSource } = {}) => {
        return "trino"
    },
    driverFactory: ({ dataSource } = {}) => {
        return new PrestoDriver({
            checkInterval:50   // 调整一个比较合适的,后期修改为线性补偿的
        })
    }
}; 

参考资料

https://github.com/rongfengliang/cubejs-trino-driver

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

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2020-04-13 easy-rules facts 规则引擎说明
2020-04-13 easy-rules facts 说明
2020-04-13 easy-rules rule 格式说明
2020-04-13 easy-rules json 文件格式rule定义
2019-04-13 influxdb 全家桶运行
2018-04-13 使用gopherjs 进行web 应用开发
2014-04-13 XDomainRequest object

导航

< 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
点击右上角即可分享
微信分享提示