-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-1778959: Binary value '14843418AF05FDC3C69C' is too long and would be truncated #1952
Comments
@amergey thanks for raising this issue. That error is returned from the backend; it's not a JDBC driver issue unless there's a problem with the data that it's sending and it's not the same data you were expecting to see. Does that binary data If the error is showing you a value that you're not expecting, then can you provide an example code snippet showing how you generated this data and how you prepared your statement in your Java code? Otherwise, if the data matches what you sent, then it's not a JDBC issue. You will need to open a support case to have that looked at. |
@sfc-gh-wfateem thanks for you answer. |
Thanks for the response @amergey. |
@amergey I just got around to checking this. I'm not seeing the issue you reported.
That runs fine and I confirmed that the data landed in that table. Refer to the screenshot below showing the results of a select query on that same table: Can you share the code you used to reproduce your issue, please? The only way I would be able to reproduce your issue is if I attempt to insert that data into a narrower column. The binary data I created is 26 bytes, so if I declare my Binary column as So I don't quite understand how you were able to get into the situation where you get this error for a |
I've been continuously testing this and I'm unable to reproduce this unless in the expected scenario where your data length exceeds the column's length. My conclusion is that the error you were seeing was for a different schema where the column size is smaller than 10 bytes. I'm going to close this with the assumption that it's a user error, but please do come back and open this again if you have a specific code you can share with us that reproduces the issue and we'll be happy to take another look at it. |
Thanks @sfc-gh-wfateem for investigating. I do not manage to provide code to reproduce, it seems to be caused by some race condition. Wen I debug or try to isolate, everything works fine. I have the issue in the running code frequently but not always, and too much code involved with the full application. Seems to happened where 2 inserts happened almost simultanetly The error returned is probably not the real one, it makes no sense, the 10 bytes should be not overflow the binary column I am pretty sure it is not a user error but a bug somewhere |
@amergey I just wasn't a 100% sure if the error you shared (data of 10 bytes) was actually being inserted into the Binary of 8 MBs. I'm not sure your issue is going to be a straightforward problem to debug in GitHub, and based on the screenshot you just shared I'm not even sure that this is really a JDBC driver issue. In any case, it might make more sense for you to create a support ticket because this will require JDBC debugging logs and you definitely don't want to share that here. |
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
What version of JDBC driver are you using?
3.19.0
What operating system and processor architecture are you using?
Ubuntu 22.04.5
What version of Java are you using?
JDK 17
What did you do?
Execute an insert in a table with a JDBC prepared statement binding a byte[] value into a binary column
It fails with
Binary value '418E3F4240F7038405B8' is too long and would be truncated
The odd thing is, if I debug my java program and put a breakpoint to execute step by step, then it succeed
Normal run, fails all the time. Debug with breakpoint succeed all the time, so probably some race conditions
it should succeed, my table is created to contains max size binary and I set a 10 bytes byte array
The text was updated successfully, but these errors were encountered: