question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

convertInput function in the dynamodb document client casting bigint to map.

See original GitHub issue

Confirm by changing [ ] to [x] below to ensure that it’s a bug:

Describe the bug The bug should loosely be called a bug, or perhaps a feature request. In the function convertInput in the aws-sdk lib dynamodb converter.js it does not support BigInt data types. As of Node 10.x being supported with Lambdas, the BigInt data type is available to us in Node. The problem is simply, typeof(BigInt) does not evaluate to Number, or NumberValue. Instead it evaluates to ‘bigint’.

Is the issue in the browser/Node.js? Node JS for the aws-sdk > dynamodb > converter.js

If on Node.js, are you running this on AWS Lambda? Yes

Details of the browser/Node.js version Node 10.x

SDK version number AWS Lambda 10.x

To Reproduce (observed behavior) Try to store a BigInt data type from params using any of the aws-sdk dynmodb document client write functions. You’ll notice that the error states that it cannot parse an M. this is because the converter default is to try to cast it to a map rather than evaluating bigint as a number.

Expected behavior Have the converter function cast bigint to N data type as defined by the documentation. https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBMapper.DataTypes.html

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
trivikrcommented, Nov 12, 2020

We’ve published Release Candidate for AWS SDK for JavaScript v3.

As part of the RC release, we’ve published utility functions for marshall and unmarshall operations in @aws-sdk/util-dynamodb which supports BigInt conversion. These utility functions can also be used with v2 as follows:

const AWS = require("aws-sdk");
const { marshall, unmarshall } = require("@aws-sdk/util-dynamodb");
 
const client = new AWS.DynamoDB(clientParams);
const putParams = {
  TableName: "Table",
  Item: marshall({
    HashKey: "hashKey",
    BigIntAttribute: 1n,
  }),
};
 
await client.putItem(putParams).promise();

const getParams = {
  TableName: "Table",
  Key: marshall({
    HashKey: "hashKey",
  }),
};
 
const { Item } = await client.getItem(getParams);
unmarshall(Item);

1reaction
TechTeam12commented, Dec 19, 2019

Hey @ajredniwja,

Thanks for following it up. I marked it as a bug report since AWS Lambda Node 10 support BigInt officially, but the SDK does not. That was my logic, I figured if you’re running tests for Node 10 and AWS supports Node 10 it was probably a miss when adding the node version support.

Either way, let me know if there is more I can do to help. Definitely need this functionality ASAP.

Thanks,

  • Morgan
Read more comments on GitHub >

github_iconTop Results From Across the Web

dts-api-client - UNPKG
The CDN for dts-api-client. ... js-yaml/lib/js-yaml/type/js/function.js","webpack:///. ... aws-sdk/apis/dynamodb-2011-12-05.min.json","webpack:///.
Read more >
AWS Big Data | Noise | Page 5
For prospective Amazon Redshift customers, benchmarking Amazon Redshift is ... Create a JAR file containing a converter to convert input Python Objects into ......
Read more >
sitemap-questions-32.xml - Stack Overflow
... /questions/901892/python-factory-functions-compared-to-class 2022-04-16 ... -to-map-an-icefaces-iceselectinputdate-component-on-a-java-util-calendar-f ...
Read more >
Data Analytics with Spark Using Python
Data Structures Used in Functional Python Programming ... filter() transformations together to convert input text to uppercase. It uses map() and flatMap() ...
Read more >
Apropos rt - FreeBSD
... check if a file system is exported to a client; VFS_VGET(9): convert an ... mount_argsu(9): functions provided as part of the kernel...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found