domoritz commented on PR #40729: URL: https://github.com/apache/arrow/pull/40729#issuecomment-2014184479
Thanks for the pull request. This does not yet fix encoding so we cannot close https://github.com/apache/arrow/issues/37920. ```ts arrow.vectorFromArray([1, 12, 34], new arrow.Decimal(3, 18)) ``` Also, it seems like this still ignores the scale. If I try the example in https://github.com/apache/arrow/issues/37920#issue-1916512787, I still get 1000 instead of 1 (the scale is ignored). ```ts const hex = 'FFFFFFFF780000001000000000000A000C000600050008000A000000000104000C000000080008000000040008000000040000000100000014000000100014000800060007000C00000010001000000000000107100000001C0000000400000000000000010000006400000008000C0004000800080000001200000003000000FFFFFFFF8800000014000000000000000C0016000600050008000C000C0000000003040018000000300000000000000000000A0018000C00040008000A0000003C00000010000000030000000000000000000000020000000000000000000000000000000000000000000000000000003000000000000000000000000100000003000000000000000000000000000000E8030000000000000000000000000000E02E0000000000000000000000000000D0840000000000000000000000000000FFFFFFFF00000000'; const bytes = Uint8Array.from(hex.match(/.{1,2}/g).map(s => parseInt(s, 16))); const vec = arrow.tableFromIPC(bytes).getChild('d')!; console.log(vec.get(0)) // [1000, 0, 0, 0] <- byte array looks correct console.log(`${vec.get(0)}`) // "1000" <- incorrect, should be 1; ignores scale console.log(Number(vec.get(0))) // 1000 <- incorrect, should be 1 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
