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
@mathewzile Thanks for your additional insights into the issue. I just wanted to point out the official nodejs implementation of this function here used like: require('stream/consumer').blob.
I am certain that the official implementation would have had the same issue you where facing. Not sure whether you can put the mimetype onto the Blob afterwards, but I would generally recommend to use the std implementation where possible. Or if it is not possible open a PR to node they might accept it.
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: