Skip to content

Very large values in numerical columns can cause a crash due to overflow #7

Open

Description

@Schaechtle

This line can crash with an overflow error for very large values of x becasue Clojure doesn't automatically upgrade Ints to BigInts. This happend with the Gapminder dataset and is reproducible in the Clojure repl:

$ clojure
Clojure 1.11.1
user=> (def a 12756500000000)
#'user/a
user=> (* a a)
Execution error (ArithmeticException) at java.lang.Math/multiplyExact (Math.java:892).
long overflow

The value 12756500000000 is the problematic cell value in the Gapminder dataset. It's unclear whether this problem is common.

Activity

  1. pratmeha commented on Apr 20, 2023

    @pratmeha

    For what it's worth, I ran into this when working with a dataset of executable file characteristics, which contained values like memory addresses or Unix timestamps. I expect some of these, especially the timestamps, could be removed from the data without harm but sometimes that's hard to tell a priori.

    If this is troublesome to fix, I wonder if it could be worked around by approximating large integers with scientific notation? I'm not sure if that's supported, though.

  2. sritchie commented on Jul 31, 2023

    @sritchie
    Contributor

    @Schaechtle you can fix this by using *', with an extra apostrophe at the end; I'm not sure where in the code the bare * was hit, but that would be one fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions