You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Pereslegin (Jira)" <ji...@apache.org> on 2025/12/03 15:15:00 UTC

[jira] [Updated] (IGNITE-27243) Reading a null value as a primitive from a binary tuple should throw NPE instead of a BinaryTupleFormatException.

     [ https://issues.apache.org/jira/browse/IGNITE-27243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Pereslegin updated IGNITE-27243:
--------------------------------------
    Summary: Reading a null value as a primitive from a binary tuple should throw NPE instead of a BinaryTupleFormatException.  (was: Reading a null value as a primitive from a binary tuple should throw an NPE exception instead of a BinaryTupleFormatException.)

> Reading a null value as a primitive from a binary tuple should throw NPE instead of a BinaryTupleFormatException.
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-27243
>                 URL: https://issues.apache.org/jira/browse/IGNITE-27243
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql ai3
>            Reporter: Pavel Pereslegin
>            Priority: Major
>              Labels: ignite-3
>
> Currently, reading a primitive field that contains a null value throws a confusing internal {{BinaryTupleFormatException}}.
> In this case, we should throw {{NullPointerException}} instead of {{BinaryTupleFormatException}}.
> Reproducer:
> {code:java}
>     sql("CREATE TABLE t(id INT PRIMARY KEY, v1 INT, v2 INT)");
>     sql("INSERT INTO t VALUES (0, 1, NULL)");
>     
>     RecordView<Tuple> view = CLUSTER.aliveNode().tables().table("T").recordView();
>     
>     Tuple tuple = view.get(null, Tuple.create().set("id", 0));
>     
>     IgniteTestUtils.assertThrows(
>             NullPointerException.class,
>             () -> tuple.intValue("v2"),
>             null
>     );
> {code}
> {noformat}
> org.opentest4j.AssertionFailedError: Unexpected exception type thrown, 
> Expected :class java.lang.NullPointerException
> Actual   :class org.apache.ignite.internal.binarytuple.BinaryTupleFormatException
> <Click to see difference>
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)