Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support for BigInt #19237

Open
nantunes opened this issue Oct 23, 2023 · 0 comments
Open

[Feature] Support for BigInt #19237

nantunes opened this issue Oct 23, 2023 · 0 comments
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.

Comments

@nantunes
Copy link

What problem does this feature solve?

I'm working with Apache Arrow data via Arquero, and I often deal with BigInt values (Apache Arrow's Int64 type). However, Apache ECharts currently stumbles on BigInt, throwing errors like Uncaught TypeError: Cannot convert a BigInt value to a number. There were some discussions (#13819, #12873) on this, but they didn't move forward.

BigInt support is needed for dealing with high-precision timestamps (sensor data) or large integers in datasets.

Apache Arrow is a portable format for storing column-oriented data, allowing data to be shared as-is between various systems and language runtimes. Arquero can process Arrow data directly and serialize data to the Arrow format. It can read from Apache Arrow columns out-of-the-box, enabling zero-copy query processing over loaded data.

I'm trying to avoid pre-processing the data (for casting BigInt to Number), as it is a big amount of data and I would lose the zero-copy optimizations and end up with multiple copies on memory (I already have to live with the unneeded clone of data).

What does the proposed API look like?

  1. Adapt Data Handling: Adjust the data handling parts to play nice with BigInt, especially around uses of the Math API and the isFinite method. E.g. detectValue at sourceHelper.js or parseDataValue at dataValueHelper.js.

  2. Type Conversion: Provide tools to switch between BigInt and Number if needed, while ensuring no loss in precision. However, this might not be necessary as all values of a dimension are of the same type.

  3. Option API Tweak: We can allow specifying bigint type in the dataset's dimensions, although the type should be easy to guess by looking at the data.

Thanks.

@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

1 participant