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

Pavel Pereslegin resolved IGNITE-22867.
---------------------------------------
    Resolution: Cannot Reproduce

[~lunigorn], the example you posted works fine.

{code:java}
        try (ResultSet rs = stmt.executeQuery("WITH example AS (select 1 a, 2 
b, 3 c) select * from example;")) {
            assertTrue(rs.next());
            assertEquals(3, rs.getMetaData().getColumnCount());

            assertEquals("(1, 2, 3)",
                    IgniteStringFormatter.format("({}, {}, {})",
                            rs.getInt(1), rs.getInt(2), rs.getInt(3)));

            assertFalse(rs.next());
        }
{code}

I guess you tried to execute update  (stmt.executeUpdate("WITH...")). instead 
of query  (stmt.executeQuery("WITH...")).

> Support WITH ... AS
> -------------------
>
>                 Key: IGNITE-22867
>                 URL: https://issues.apache.org/jira/browse/IGNITE-22867
>             Project: Ignite
>          Issue Type: Improvement
>          Components: general, sql
>    Affects Versions: 3.0.0-beta2
>            Reporter: Igor
>            Priority: Major
>              Labels: ignite-3
>
> *Description:*
> Need to support WITH ... AS queries.
> The query
> {code:java}
> WITH example AS (select 1 a, 2 b, 3 c) select * from example;{code}
> should return
> {code:java}
> (1, 2, 3){code}
> currently returns error
> {code:java}
> Invalid SQL statement type. Expected [DML, DDL] but got QUERY{code}



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

Reply via email to