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)

貢獻者指南