You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Prashant Satam <pr...@gmail.com> on 2023/11/06 12:23:25 UTC

Review Request 74719: RANGER:4514:Sort params are interchanged in GDS API response

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74719/
-----------------------------------------------------------

Review request for ranger, Anand Nadar, Ankita Sinha, Madhan Neethiraj, Monika Kachhadiya, Subhrat Chaudhary, and Vanita Ubale.


Bugs: RANGER-4514
    https://issues.apache.org/jira/browse/RANGER-4514


Repository: ranger


Description
-------

The values of sort parameters sortBy and sortType are interchanged in the response received for the GDS APIs.

Steps to reproduce:

Create 2 datasets
Fetch them using GET API - /service/gds/dataset?sortBy=id&sortType=ASC
Expected: in response the sort params: sortBy=id, sortType=ASC
Actual response:  sort params: sortBy=ASC, sortType=id


Diffs
-----

  security-admin/src/main/java/org/apache/ranger/biz/GdsDBStore.java 4249b1121 


Diff: https://reviews.apache.org/r/74719/diff/1/


Testing
-------

Testing Steps
1)Create 2 datasets
2)Fetch them using GET API - /service/gds/dataset?sortBy=id&sortType=ASC
3)In Response we get sortBy=ASC, sortType=id correctly
Response
{
    "startIndex": 0,
    "pageSize": 1,
    "totalCount": 3,
    "resultSize": 1,
    "sortType": "asc",
    "sortBy": "datasetId",
    "queryTimeMS": 1699273018014,
    "list": [
        {
            "id": 1,
            "guid": "51990db5-533e-4358-9fba-96758f93387f",
            "isEnabled": true,
            "createdBy": "Admin",
            "updatedBy": "Admin",
            "createTime": 1699010197633,
            "updateTime": 1699011093627,
            "version": 4,
            "description": "This is GDS description",
            "options": {
                "property1": "GDS_1_options",
                "property2": "GDS_2_options"
            },
            "additionalInfo": {
                "property1": "GDS_1_additionalInfo",
                "property2": "GDS_2_additionalInfo"
            },
            "name": "Test_GDS_Dataset1",
            "acl": {
                "users": {
                    "admin": "ADMIN",
                    "Test-User-1": "AUDIT"
                }
            },
            "termsOfUse": "Gds Terms of Use"
        }
    ],
    "listSize": 1
}


Thanks,

Prashant Satam


Re: Review Request 74719: RANGER:4514:Sort params are interchanged in GDS API response

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74719/#review225937
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On Nov. 6, 2023, 12:23 p.m., Prashant Satam wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74719/
> -----------------------------------------------------------
> 
> (Updated Nov. 6, 2023, 12:23 p.m.)
> 
> 
> Review request for ranger, Anand Nadar, Ankita Sinha, Madhan Neethiraj, Monika Kachhadiya, Subhrat Chaudhary, and Vanita Ubale.
> 
> 
> Bugs: RANGER-4514
>     https://issues.apache.org/jira/browse/RANGER-4514
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> The values of sort parameters sortBy and sortType are interchanged in the response received for the GDS APIs.
> 
> Steps to reproduce:
> 
> Create 2 datasets
> Fetch them using GET API - /service/gds/dataset?sortBy=id&sortType=ASC
> Expected: in response the sort params: sortBy=id, sortType=ASC
> Actual response:  sort params: sortBy=ASC, sortType=id
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/GdsDBStore.java 4249b1121 
> 
> 
> Diff: https://reviews.apache.org/r/74719/diff/1/
> 
> 
> Testing
> -------
> 
> Testing Steps
> 1)Create 2 datasets
> 2)Fetch them using GET API - /service/gds/dataset?sortBy=id&sortType=ASC
> 3)In Response we get sortBy=ASC, sortType=id correctly
> Response
> {
>     "startIndex": 0,
>     "pageSize": 1,
>     "totalCount": 3,
>     "resultSize": 1,
>     "sortType": "asc",
>     "sortBy": "datasetId",
>     "queryTimeMS": 1699273018014,
>     "list": [
>         {
>             "id": 1,
>             "guid": "51990db5-533e-4358-9fba-96758f93387f",
>             "isEnabled": true,
>             "createdBy": "Admin",
>             "updatedBy": "Admin",
>             "createTime": 1699010197633,
>             "updateTime": 1699011093627,
>             "version": 4,
>             "description": "This is GDS description",
>             "options": {
>                 "property1": "GDS_1_options",
>                 "property2": "GDS_2_options"
>             },
>             "additionalInfo": {
>                 "property1": "GDS_1_additionalInfo",
>                 "property2": "GDS_2_additionalInfo"
>             },
>             "name": "Test_GDS_Dataset1",
>             "acl": {
>                 "users": {
>                     "admin": "ADMIN",
>                     "Test-User-1": "AUDIT"
>                 }
>             },
>             "termsOfUse": "Gds Terms of Use"
>         }
>     ],
>     "listSize": 1
> }
> 
> 
> Thanks,
> 
> Prashant Satam
> 
>