cube-js/cube

`UInt64` value returned from ClickHouse is truncated on Cube side

Open

#6,182 创建于 2023年2月21日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Rust (1,965 fork)batch import
driver:clickhousehelp wanted

仓库指标

Star
 (19,563 star)
PR 合并指标
 (平均合并 5天 16小时) (30 天内合并 138 个 PR)

描述

Describe the bug We have such dimension in Sales cube. Clickhouse is an underlying database

"saleKey":{
   "sql":"`farmHash64(doesnt matter what is inside)`",
   "type":"`number`",
   "primaryKey":true,
   "shown":true
},

farmHash64 returns UInt64 — [0 : 18446744073709551615]

Lets run script

select saleKey
from public.Sales limit 4

We are getting response

saleKey
8307928136669839400
12604678624050645000
15207895910732839000
16946569575044143000

But corresponding sql query returns other values. Attaching response from redis cache as an evidence


{
    "time": 1676967618149,
    "result": [
        {
            "sales__sale_key": "8307928136669839578"
        },
        {
            "sales__sale_key": "12604678624050644212"
        },
        {
            "sales__sale_key": "15207895910732839290"
        },
        {
            "sales__sale_key": "16946569575044142817"
        }
    ],
    "renewalKey": "SQL_QUERY_RESULT_STANDALONE_d1eff3196b1ea88672b632c472d243bc"
}

It easy to see that last 4 digits are not the same, why?

Expected behavior Values returned via script and sql-api are the same

Version: cubejs/cube:v0.30.62

Additional request Pls point to the source code line where truncation happens, if possible)

贡献者指南