ptupitsyn commented on code in PR #1927:
URL: https://github.com/apache/ignite-3/pull/1927#discussion_r1162591600


##########
modules/binary-tuple/src/main/java/org/apache/ignite/internal/binarytuple/BinaryTupleParser.java:
##########
@@ -298,15 +303,16 @@ public final float floatValue(int begin, int end) {
      * @return Element value.
      */
     public final double doubleValue(int begin, int end) {
-        switch (end - begin) {
+        int len = end - begin;
+        switch (len) {
             case 0:
                 return 0.0;
             case Float.BYTES:
                 return buffer.getFloat(begin);
             case Double.BYTES:
                 return buffer.getDouble(begin);
             default:
-                throw new BinaryTupleFormatException("Invalid length for a 
tuple element");
+                throw new BinaryTupleFormatException("Invalid length for a 
tuple element: " + len);

Review Comment:
   This exception should not happen, it indicates a bug in Ignite (when we have 
corrupted schema or corrupted data). So yes, stack trace should be enough to 
know the type, but seeing actual length may be helpful for us to debug the 
issue.



-- 
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]

Reply via email to