You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/02/23 06:54:17 UTC

[GitHub] [iceberg] kevinliu-stripe opened a new issue #4204: Snapshot as LongType in metadata tables

kevinliu-stripe opened a new issue #4204:
URL: https://github.com/apache/iceberg/issues/4204


   #### Ask
   Metadata tables (defined in #252) defines `snapshot_id` and `parent_id` a `LongType` value. Can this be defined as string value instead? As far as I know, there's no arithmetic operations on snapshot it, nor should there be. 
   
   #### Problem
   In our setup of Iceberg + Trino, we use an internal frontend to display the metadata table from Trino. The `snapshot_id` field is represented in `LongType` which is translated to Javascript Number. Because of the length of the snapshot id, the representation is truncated so snapshot id `5184430069070270604` becomes `5184430069070270000`, with the last 3 digits are 0'ed out.
   
   This problem is due to transporting the result data to the frontend as JSON representation and JSON representation of numbers has an upper limit on the size of the number it can handle. [Here are some relevant links](https://www.npmjs.com/package/json-bigint#links).
   
   #### Possible solution
   The workaround on our side was to use the [`bignumber` javascript library](https://mikemcl.github.io/bignumber.js/) to represent snapshot id in JSON as a "big number" so it is not truncated...
   
   I think a better solution is to represent the `snapshot_id` (and related fields) as string value in the schema definition of the metadata tables
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org