`UInt64` value returned from ClickHouse is truncated on Cube side
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)
If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you. If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines. You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.
Looks like this still reproduces on Cube v0.36.7. The value of 18446744073709551604 is similarly truncated: