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

Integer greater than 32-bit integer cannot be used as key in transformation #1278

Open
vinkrish opened this issue Feb 4, 2025 · 1 comment

Comments

@vinkrish
Copy link

vinkrish commented Feb 4, 2025

For following example if Number exceeds 2147483647, accessing @(1,Number) breaks the transormation outputting wrong integer key

Input:

{
  "Student": {
    "Number": 2147483648,
    "KEY": "label",
    "VALUE": "test"
  }
}

Jolt Spec:

[
  {
    "operation": "shift",
    "spec": {
      "Student": {
        "VALUE": "Student.data.@(1,Number).@(1,KEY)"
      }
    }
   }
]

Output:

{
  "Student" : {
    "data" : {
      "-2147483648" : {
        "label" : "test"
      }
    }
  }
}

@barbaros74
Copy link

You can overcome the issue with a modify spec such as

[
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "Student": {
        "Number": "=toString"
      }
    }
  },
  {
    "operation": "shift",
    "spec": {
      "Student": {
        "VALUE": "&1.data.@1,Number.@1,KEY"
      }
    }
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants