You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the file @cap-js/hana/lib/drivers/hana-client.js at function streamBlob, because the binary buffer is assigned to 65536 ( 1 << 16).
if the file is large, then the first 65536 bytes are read and then the next read overwrites the first few bytes which corrupts the file signature.
for now i was able to fix with a patch something like this -async function* streamBlob(rs, rowIndex = -1, columnIndex, binaryBuffer = Buffer.allocUnsafe(1 << 16)) { +async function* streamBlob(rs, rowIndex = -1, columnIndex, binaryBuffer = Buffer.allocUnsafe(1 << 25)) {
The text was updated successfully, but these errors were encountered:
i am also facing this issue using @sap/hana-client. document stream retrieved from SELECT and converted to Blob ends up with errors when passed to Langchain's document loaders.
this does not happen with hdb driver (there's an unrelated issue with that driver regarding streams and draft activation)
EDIT: this is resolved in my scenario, so it might be an unrelated issue from the OP's. it was due to the buffer for each data chunk being mutated, resulting in the same data chunk in my final array:
i fixed it by creating a copy of the buffer on each read
I am working on a multitenant CAP application the dependencies are as below
in the file @cap-js/hana/lib/drivers/hana-client.js at function streamBlob, because the binary buffer is assigned to 65536 ( 1 << 16).
if the file is large, then the first 65536 bytes are read and then the next read overwrites the first few bytes which corrupts the file signature.
for now i was able to fix with a patch something like this
-async function* streamBlob(rs, rowIndex = -1, columnIndex, binaryBuffer = Buffer.allocUnsafe(1 << 16)) { +async function* streamBlob(rs, rowIndex = -1, columnIndex, binaryBuffer = Buffer.allocUnsafe(1 << 25)) {
The text was updated successfully, but these errors were encountered: