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

Pavel Pereslegin updated IGNITE-27243:
--------------------------------------
    Fix Version/s: 3.2

> 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
>            Assignee: Pavel Pereslegin
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.2
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> 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
> {noformat}



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

Reply via email to