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

Custom type conversion to double from large long #4099

Merged
merged 3 commits into from
Jan 31, 2023

Commits on Jan 31, 2023

  1. Custom type conversion to double from large long

    When a large long would be passed to a host call expecting a double,
    it would crash with a
    ```
    Cannot convert '<some long>'(language: Java, type: java.lang.Long) to Java type 'double': Invalid or lossy primitive coercion
    ```
    
    That is unlikely to be expected by users. It also came up in the
    Statistics examples during Sum. One could workaround it by forcing the
    conversion manually with `.to_decimal` but it is not a permanent
    solution.
    
    Instead this change adds a custom type mapping from Long to Double that
    will do it behind the scenes with no user interaction. The mapping kicks
    in only for really large longs.
    hubertp committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    7cc9622 View commit details
    Browse the repository at this point in the history
  2. update changelog

    hubertp committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    1c7198b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8a4deb3 View commit details
    Browse the repository at this point in the history