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
질문됨 2달 전114회 조회
1개 답변
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
지원 엔지니어
답변함 2달 전
profile picture
전문가
검토됨 2달 전
  • 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)

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠