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

Kirill Tkalenko updated IGNITE-29034:
-------------------------------------
    Description: 
Add support for the {{DUAL}} pseudo-table.

Calcite exposes this capability through 
{{{}SqlConformance.isSupportedDualTable(){}}}, but Ignite does not currently 
register {{DUAL}} in its schemas.

When this conformance option is enabled, {{DUAL}} should be exposed as a 
virtual table with Oracle-compatible contents:
 * Exactly one row.
 * One column named {{{}DUMMY{}}}.
 * Column value {{{}'X'{}}}.

The following queries should work:
{noformat}
SELECT 1 + 1 FROM DUAL;
SELECT DUMMY FROM DUAL; SELECT LAG(rate, 1, rate) OVER (ORDER BY period) FROM 
(SELECT 1 AS rate, 1 AS period FROM DUAL);
{noformat}
Acceptance criteria:
 * {{DUAL}} is registered when the active SQL conformance supports it.
 * {{SELECT * FROM DUAL}} returns one row with {{{}DUMMY = 'X'{}}}.
 * {{DUAL}} works in nested queries and with window functions.
 * An existing user table or view named {{DUAL}} is not overwritten.
 * Integration tests cover expressions, the {{DUMMY}} column, and window 
functions.

  was:
Add support for the {{DUAL}} pseudo-table.

Calcite exposes this capability through 
{{{}SqlConformance.isSupportedDualTable(){}}}, but Ignite does not currently 
register {{DUAL}} in its schemas.

When this conformance option is enabled, {{DUAL}} should be exposed as a 
virtual table with Oracle-compatible contents:
 * Exactly one row.
 * One column named {{{}DUMMY{}}}.
 * Column value {{{}'X'{}}}.

The following queries should work:

{{}}
{noformat}
SELECT 1 + 1 FROM DUAL;
SELECT DUMMY FROM DUAL; SELECT LAG(rate, 1, rate) OVER (ORDER BY period) FROM 
(SELECT 1 AS rate, 1 AS period FROM DUAL);
{noformat}
{{}}

Acceptance criteria:
 * {{DUAL}} is registered when the active SQL conformance supports it.
 * {{SELECT * FROM DUAL}} returns one row with {{{}DUMMY = 'X'{}}}.
 * {{DUAL}} works in nested queries and with window functions.
 * An existing user table or view named {{DUAL}} is not overwritten.
 * Integration tests cover expressions, the {{DUMMY}} column, and window 
functions.


> SQL Calcite: Add support for FROM DUAL queries
> ----------------------------------------------
>
>                 Key: IGNITE-29034
>                 URL: https://issues.apache.org/jira/browse/IGNITE-29034
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Kirill Tkalenko
>            Assignee: Kirill Tkalenko
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Add support for the {{DUAL}} pseudo-table.
> Calcite exposes this capability through 
> {{{}SqlConformance.isSupportedDualTable(){}}}, but Ignite does not currently 
> register {{DUAL}} in its schemas.
> When this conformance option is enabled, {{DUAL}} should be exposed as a 
> virtual table with Oracle-compatible contents:
>  * Exactly one row.
>  * One column named {{{}DUMMY{}}}.
>  * Column value {{{}'X'{}}}.
> The following queries should work:
> {noformat}
> SELECT 1 + 1 FROM DUAL;
> SELECT DUMMY FROM DUAL; SELECT LAG(rate, 1, rate) OVER (ORDER BY period) FROM 
> (SELECT 1 AS rate, 1 AS period FROM DUAL);
> {noformat}
> Acceptance criteria:
>  * {{DUAL}} is registered when the active SQL conformance supports it.
>  * {{SELECT * FROM DUAL}} returns one row with {{{}DUMMY = 'X'{}}}.
>  * {{DUAL}} works in nested queries and with window functions.
>  * An existing user table or view named {{DUAL}} is not overwritten.
>  * Integration tests cover expressions, the {{DUMMY}} column, and window 
> functions.



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

Reply via email to