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
User @cloudcell on duckdb discord raised this issue:
Hello, I am using dbeaver to view the contents of the database that has a BLOB field; however, instead of data I see this:
DuckDBBlobResult{buffer=java.nio.DirectByteBuffer[pos=0 lim=2 cap=2]}
Does anyone have any ideas what's going wrong?
I am able to reproduce this with GA duckdb JDBC.
I checked a similar example with MySQL and found DBeaver to return the blob data as string.
In other words, it appears to have to do with the DuckDB driver, not DBeaver software.
I tried to figure out how DBeaver displays the Blobs but have not been able to analyze their code.
It's probably there somewhere but I can't find it.
I have looked into the DuckDB JDBC driver and I have found some pieces of code that might explain the behavior.
(To be clear, I am not saying this is the cause, I'm just saying that this would explain it if we assume DBeaver calls getString on the JDBC resultset for the Blob column)
I think it is not entirely clear whether this is a bug or not.
It is of course mighty inconvenient for DBeaver users.
The text was updated successfully, but these errors were encountered:
The previous version of DBeaver did support BLOBs, however the behavior was somewhat problematic. For example, it would not show you the blob unless you clicked on the cell within the record. Also, the first record of the table would show different values when being repeatedly updated. I am currently using SQLTools for VSCode, which shows the beginning of every BLOB record, which is totally fine. Perhaps someone can adapt some code used in SQLTools.
User @cloudcell on duckdb discord raised this issue:
I am able to reproduce this with GA duckdb JDBC.
I checked a similar example with MySQL and found DBeaver to return the blob data as string.
In other words, it appears to have to do with the DuckDB driver, not DBeaver software.
I tried to figure out how DBeaver displays the Blobs but have not been able to analyze their code.
It's probably there somewhere but I can't find it.
I have looked into the DuckDB JDBC driver and I have found some pieces of code that might explain the behavior.
If DBeaver uses the JDBC
getString(column)
method, (https://github.com/duckdb/duckdb-java/blob/main/src/main/java/org/duckdb/DuckDBResultSet.java#L206), then the DuckDB driver ends up callinggetObject()
and then appliestoString()
to the object value.The resultset
getObject()
is implemented by callinggetObject()
on theDuckDBVector
(https://github.com/duckdb/duckdb-java/blob/main/src/main/java/org/duckdb/DuckDBVector.java#L112), and for Blob data type this will instantiateDuckDBResultSet.DuckDBBlobResult
(https://github.com/duckdb/duckdb-java/blob/main/src/main/java/org/duckdb/DuckDBVector.java#L276), which overridestoString()
to return something that looks a lot like what we see in the DBeaver interface (https://github.com/duckdb/duckdb-java/blob/main/src/main/java/org/duckdb/DuckDBResultSet.java#L492)(To be clear, I am not saying this is the cause, I'm just saying that this would explain it if we assume DBeaver calls getString on the JDBC resultset for the Blob column)
I think it is not entirely clear whether this is a bug or not.
It is of course mighty inconvenient for DBeaver users.
The text was updated successfully, but these errors were encountered: