[ 
https://issues.apache.org/jira/browse/IGNITE-10424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18133535#comment-18133535
 ] 

Zhang Zhenhao commented on IGNITE-10424:
----------------------------------------

Reproduced on current master (2026-10-28): a map-side failure of a distributed
query (\{{SELECT SUM(field2 * 1000000000)}} on an int column, numeric overflow)
surfaces to the client as a bare \{{javax.cache.CacheException}} with no
{\{IgniteSQLException}} in the cause chain.

Root cause: \{{GridMapQueryExecutor.sendError()}} collapses the map-side
throwable into \{{GridQueryFailResponse}}, which carries only the error message
string and a fail code — the \{{IgniteSQLException}} type and status code are
lost on the wire, so \{{GridReduceQueryExecutor.fail()}} cannot reconstruct it.

I'm working on a fix: carry the map-side SQL status code through
{\{GridQueryFailResponse}} (rolling-upgrade gated field) and restore
{\{IgniteSQLException}} as the cause of the \{{CacheException}} built in
{\{GridReduceQueryExecutor.fail()}}. A PR will follow shortly.

> CacheException thrown instead of SqlException
> ---------------------------------------------
>
>                 Key: IGNITE-10424
>                 URL: https://issues.apache.org/jira/browse/IGNITE-10424
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.5
>            Reporter: Max Shonichev
>            Priority: Major
>              Labels: newbie, sql
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> When running query 
> {noformat}
> SELECT SUM(field2*1000000000) FROM tmp_table_age_name_wage;
> {noformat}
> Apache Ignite 2.4 threw SqlException Numeric value out of range: 
> "100000000000000";
> Apache Ignite 2.5 does not wrap underlying exception and throws 
> javax.cache.CacheException instead
> {noformat}
> SELECT SUM(field2*1000000000) FROM tmp_table_age_name_wage;
> Expected error:
> Numeric value out of range
> Actual error:
> Error: javax.cache.CacheException: Failed to execute map query on remote node 
> [nodeId=76cea51c-87a3-4054-b39e-1ad6d01c0df6, errMsg=Failed to execute SQL 
> query. Numeric value out of range: "100000000000000"; SQL statement:
>  SELECT
>  SUM(__Z0.FIELD2 * 1000000000) __C0_0
>  FROM PUBLIC.TMP_TABLE_AGE_NAME_WAGE __Z0 [22003-195]] (state=50000,code=0)
>  java.sql.SQLException: javax.cache.CacheException: Failed to execute map 
> query on remote node [nodeId=76cea51c-87a3-4054-b39e-1ad6d01c0df6, 
> errMsg=Failed to execute SQL query. Numeric value out of range: 
> "100000000000000"; SQL statement:
>  SELECT
>  SUM(__Z0.FIELD2 * 1000000000) __C0_0
>  FROM PUBLIC.TMP_TABLE_AGE_NAME_WAGE __Z0 [22003-195]]
>       at 
> org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:779)
>       at 
> org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:210)
>       at 
> org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:473)
>       at sqlline.Commands.execute(Commands.java:823)
>       at sqlline.Commands.sql(Commands.java:733)
>       at sqlline.SqlLine.dispatch(SqlLine.java:795)
>       at sqlline.SqlLine.runCommands(SqlLine.java:1706)
>       at sqlline.Commands.run(Commands.java:1317)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
>       at sqlline.SqlLine.dispatch(SqlLine.java:791)
>       at sqlline.SqlLine.initArgs(SqlLine.java:595)
>       at sqlline.SqlLine.begin(SqlLine.java:643)
>       at sqlline.SqlLine.start(SqlLine.java:373)
>       at sqlline.SqlLine.main(SqlLine.java:265)
> {noformat}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to