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

Yuxin Wu updated CALCITE-5562:
------------------------------
    Description: 
*It's based on CSV-TEST-MODEL. The same as {{{}lex=MYSQL{}}}.*
{quote}!connect jdbc:calcite:model=src/test/resources/mode
{quote}
----
Step1: You need to get a table named 'emps' with data as below;
{panel}
0: jdbc:calcite:model=src/test/resources/mode> select name, empid from emps;
|NAME|EMPID|
|Fred|30  |
|Eric|3    |
|John|2    |
|Wilma|1    |
|Alice|2    |

 
{panel}
Step2: Get an ordered set by using {_}{color:#172b4d}*{{select name, empid from 
emps order by empid}}*{color}{_};
{panel}
0: jdbc:calcite:model=src/test/resources/mode> select name, empid from emps 
order by empid;
|NAME|EMPID|
|Wilma|1    |
|John|2    |
|Alice|2    |
|Eric|3    |
|Fred|30  |
{panel}
 
Step3: Using the statement in step2 as a sub query like this:
{panel}
0: jdbc:calcite:model=src/test/resources/mode> select * from (select name, 
empid from emps order by empid);
|NAME|EMPID|
|Fred|30  |
|Eric|3    |
|John|2    |
|Wilma|1    |
|Alice|2    |
{panel}
 
*THE QUESTION IS:*

*The result data is disordered while it's supposed to be the same as it is in 
step2.*

  was:
*It's based on CSV-TEST-MODEL. The same as {{{}lex=MYSQL{}}}.*
{quote}!connect jdbc:calcite:model=src/test/resources/mode
{quote}
----
Step1: You need to get a table named 'emps' with data as below;
0: jdbc:calcite:model=src/test/resources/mode> select name, empid from emps;
|NAME|EMPID|
|Fred|30  |
|Eric|3    |
|John|2    |
|Wilma|1    |
|Alice|2    |


Step2: Get an ordered set by using {_}{color:#172b4d}*{{select name, empid from 
emps order by empid}}*{color}{_};
0: jdbc:calcite:model=src/test/resources/mode> select name, empid from emps 
order by empid;
|NAME|EMPID|
|Wilma|1    |
|John|2    |
|Alice|2    |
|Eric|3    |
|Fred|30  |


Step3: Using the statement in step2 as a sub query like this:
0: jdbc:calcite:model=src/test/resources/mode> select * from (select name, 
empid from emps order by empid);
|NAME|EMPID|
|Fred|30  |
|Eric|3    |
|John|2    |
|Wilma|1    |
|Alice|2    |


*THE QUESTION IS:*

*The result data is disordered while it's supposed to be the same as it is in 
step2.*


> The result data is disordered when u tried to get data from an ordered set
> --------------------------------------------------------------------------
>
>                 Key: CALCITE-5562
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5562
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Yuxin Wu
>            Priority: Major
>
> *It's based on CSV-TEST-MODEL. The same as {{{}lex=MYSQL{}}}.*
> {quote}!connect jdbc:calcite:model=src/test/resources/mode
> {quote}
> ----
> Step1: You need to get a table named 'emps' with data as below;
> {panel}
> 0: jdbc:calcite:model=src/test/resources/mode> select name, empid from emps;
> |NAME|EMPID|
> |Fred|30  |
> |Eric|3    |
> |John|2    |
> |Wilma|1    |
> |Alice|2    |
>  
> {panel}
> Step2: Get an ordered set by using {_}{color:#172b4d}*{{select name, empid 
> from emps order by empid}}*{color}{_};
> {panel}
> 0: jdbc:calcite:model=src/test/resources/mode> select name, empid from emps 
> order by empid;
> |NAME|EMPID|
> |Wilma|1    |
> |John|2    |
> |Alice|2    |
> |Eric|3    |
> |Fred|30  |
> {panel}
>  
> Step3: Using the statement in step2 as a sub query like this:
> {panel}
> 0: jdbc:calcite:model=src/test/resources/mode> select * from (select name, 
> empid from emps order by empid);
> |NAME|EMPID|
> |Fred|30  |
> |Eric|3    |
> |John|2    |
> |Wilma|1    |
> |Alice|2    |
> {panel}
>  
> *THE QUESTION IS:*
> *The result data is disordered while it's supposed to be the same as it is in 
> step2.*



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

Reply via email to