Quantum Ledger Database (QLDB) Integer overflow

0

The integer type in QLDB is defined as...

https://docs.aws.amazon.com/qldb/latest/developerguide/ql-reference.data-types.html int Signed integers of arbitrary size

....arbitrary size....but running this statement....

INSERT INTO Ledger VALUE {'Identifier': 51, 'DebitAccountIdentifier': 1, 'CreditAccountIdentifier': 2, 'Amount': 146141183460469231731687303715884105727, 'When': 5329453245235, 'CorrelationIdentifier': 77, 'Annotation': 'PartiQL'}

....receives the error....

Evaluator Error: at line 1, column 114: Int overflow or underflow, <UNKNOWN> : <UNKNOWN>; Int overflow or underflow

How can I insert an integer value greater than 'int64' ?

Thanks,

Paul

PK
asked 7 months ago193 views
1 Answer
0

Greetings,

There seems to be a limit when it comes to saving integers, it is 19 numbers or less in QLDB. I tried to replicate the scenario using the below INSERT syntax.

INSERT INTO DriversLicense
<< {
    'LicensePlateNumber' : 'LEWISR261LL',
    'LicenseType' : 'Learner',
    'ValidFromDate' : `2016-12-20T`,
    'ValidToDate' : `2020-11-15T`,
    'PersonId' : 146141183460469231731687303715884105727
} >>

the above returns:

Evaluator Error: at line 7, column 18: Int overflow or underflow, <UNKNOWN> : <UNKNOWN>; Int overflow or underflow

If I save the below, the data is persisted.

INSERT INTO DriversLicense
<< {
    'LicensePlateNumber' : 'LEWISR261LL',
    'LicenseType' : 'Learner',
    'ValidFromDate' : `2016-12-20T`,
    'ValidToDate' : `2020-11-15T`,
    'PersonId' : -9223372036854775808
} >>

Similarly if I save the following, the data is persisted with no issue as well.

INSERT INTO DriversLicense
<< {
    'LicensePlateNumber' : 'LEWISR261LL',
    'LicenseType' : 'Learner',
    'ValidFromDate' : `2016-12-20T`,
    'ValidToDate' : `2020-11-15T`,
    'PersonId' : 9223372036854775807
} >>

If you can afford to save number as a string in QLDB and handle the conversion within your application syntax (client side) than you can use that as the workaround. If you try to do the same INSERT operation where 'PersonId' : '146141183460469231731687303715884105727' the operation is a success. There is a limit of 20 numbers for integer columns in QLDB. I hope this is helpful. If you feel that I have mistaken what you are asking, please reach out to QLDB Support from your AWS Management console with your relevent ledger (also tables) details and business use case.

AWS
SUPPORT ENGINEER
answered 6 months ago
profile picture
EXPERT
reviewed 6 months ago
  • Thanks for the response and illustration. You say 'There is a limit of 20 numbers for integer columns in QLDB' but I cannot see that documented anywhere and the link to the documentation I provided says 'Signed integers of arbitrary size'. Is this a case of the documentation being wrong and requiring amendment ?
    (I have logged a support case but after 2 weeks it remained unassigned/unanswered hence creating this question...I need a support plan refund)

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions