You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Isaac Zhu (Jira)" <ji...@apache.org> on 2020/05/01 14:20:00 UTC

[jira] [Updated] (IGNITE-12974) pyignite client sql query result has wrong columns order in continuous pages

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

Isaac Zhu updated IGNITE-12974:
-------------------------------
    Description: 
When the table has more than 10 columns and the query has more than 1 row to return, like:

{color:#0747a6}_result = client.sql(query_str="select * from table_foo LIMIT 5", include_field_names=True)_{color}

{color:#0747a6}_for row in result:_{color}
 {color:#0747a6}    _print(row)_{color}

Only the first row(returned within the first page) will have the correct columns order. The rest rows will have wrong order.

This is because this line:

[https://github.com/apache/ignite/blob/master/modules/platforms/python/pyignite/api/sql.py#L445]

It does an alphabet sorting to the field names which field10 will be right after field1 instead of field9. I don't think this is needed, the "row_dict" is already an OrderedDictionary type.

I tried remove the "sorted" function call in my local version, and the order becomes correct for all pages.

  was:
When the table has more than 10 columns and the query has more than 1 row to return, like:

{color:#0747a6}_result = client.sql(query_str="select * from table_foo LIMIT 5", include_field_names=True)_{color}

{color:#0747a6}_for row in result:_{color}
{color:#0747a6}    _print(row)_{color}

Only the first row(returned within the first page) will have the correct columns order. The rest rows will have wrong order.

This is because this line:

[https://github.com/apache/ignite/blob/5ad8944992e49788828e915a8d068f3706616f9a/modules/platforms/python/pyignite/api/sql.py#L445]

It does an alphabet sorting to the field names which field10 will be right after field1 instead of field9. I don't think this is needed, the "row_dict" is already an OrderedDictionary type.

I tried remove the "sorted" function call in my local version, and the order becomes correct for all pages.


> pyignite client sql query result has wrong columns order in continuous pages 
> -----------------------------------------------------------------------------
>
>                 Key: IGNITE-12974
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12974
>             Project: Ignite
>          Issue Type: Bug
>          Components: python
>    Affects Versions: 2.7.6
>            Reporter: Isaac Zhu
>            Priority: Major
>             Fix For: None
>
>
> When the table has more than 10 columns and the query has more than 1 row to return, like:
> {color:#0747a6}_result = client.sql(query_str="select * from table_foo LIMIT 5", include_field_names=True)_{color}
> {color:#0747a6}_for row in result:_{color}
>  {color:#0747a6}    _print(row)_{color}
> Only the first row(returned within the first page) will have the correct columns order. The rest rows will have wrong order.
> This is because this line:
> [https://github.com/apache/ignite/blob/master/modules/platforms/python/pyignite/api/sql.py#L445]
> It does an alphabet sorting to the field names which field10 will be right after field1 instead of field9. I don't think this is needed, the "row_dict" is already an OrderedDictionary type.
> I tried remove the "sorted" function call in my local version, and the order becomes correct for all pages.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)