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

Vladislav Pyatkov commented on IGNITE-29157:
--------------------------------------------

This is an Ignite-specific issue, regardless of whether the equivalent issue is 
fixed in Calcite. Ignite performs its own result conversion in 
TypeUtils.resultTypeConverter, which previously handled only top-level scalar 
values and did not recursively convert values nested inside ROW, ARRAY, and 
MAP. Therefore, the fix in Ignite remains necessary after upgrading Calcite.
This fix is also a prerequisite for integrating Calcite’s CYCLE clause support 
into Ignite (IGNITE-29060). The generated path column is an ARRAY of ROW 
values, so its nested fields must be converted to external Java types when 
returned to the caller, consistently with ordinary scalar result columns.

> SQL Calcite: Convert nested SQL values to external Java types in query results
> ------------------------------------------------------------------------------
>
>                 Key: IGNITE-29157
>                 URL: https://issues.apache.org/jira/browse/IGNITE-29157
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Vladislav Pyatkov
>            Assignee: Kirill Tkalenko
>            Priority: Major
>              Labels: calcite, ignite-2, sql
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The Calcite query engine converts scalar result columns to external Java 
> types, but does not apply equivalent conversions to values nested inside 
> {{ROW}}, {{ARRAY}}, and {{MAP}}.
> For example:
> {code:sql}
> SELECT DATE '2026-01-01';
> -- Returns java.sql.Date.
> SELECT ARRAY[DATE '2026-01-01'];
> -- Returns a List containing Integer 20454.
> SELECT ROW(DATE '2026-01-01', 42);
> -- Returns Object[] with Integer 20454 in the first field.
> SELECT MAP['date', DATE '2026-01-01'];
> -- Returns a Map containing Integer 20454 as the value.
> {code}
> The same issue affects time, timestamp, interval, and binary values: internal 
> representations are exposed to the caller.
> h3. Definition of done
> * Values inside ROW, ARRAY, and MAP are recursively converted to external 
> Java types.
> * NULL values and source containers are preserved.
> * Values requiring no conversion retain the existing fast path.



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

Reply via email to