Skip to content

Sink config parsing doesn't preserve the original data type #10440

Closed

Description

@abhilashmandaliya

Describe the bug
Pulsar IO Sink config parsing is using Gson to parse the user-supplied config. Gson parses numeric values to double if we parse it to Java's Object class. This can be a problem in cases where the numeric value is a Long number above 2^52. Even there can be use cases where int should remain int after parsing.

To Reproduce
Steps to reproduce the behavior:

  1. Use Java's Long.MAX_VALUE in the sink config and access it inside sink's implementation. It would be a double value where the last few digits would be different than the original value.

Expected behavior
The original type should be preserved.

Activity

  1. added
    type/bug
    on Apr 29, 2021
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

    type/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions