You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "Xuze Yang (Jira)" <ji...@apache.org> on 2021/10/27 12:48:00 UTC

[jira] [Created] (RANGER-3500) Ranger policy list doesn't support sorting by field

Xuze Yang created RANGER-3500:
---------------------------------

             Summary: Ranger policy list doesn't support sorting by field
                 Key: RANGER-3500
                 URL: https://issues.apache.org/jira/browse/RANGER-3500
             Project: Ranger
          Issue Type: Bug
          Components: admin
    Affects Versions: 2.1.0
            Reporter: Xuze Yang


When getting the ranger policy list, we may want to sort the returned policy list according to certain fields, such as policyId, policyName and etc. But case shows that adding the parameters sortBy and sortType to the url has no effect (eg: http://192.168.0.12:6080/service/plugins/ policies/service/2?sortBy=policyName&sortType=desc&serviceName=default-Hdfs). I look through the source code and find that code supports sorting by fields, but due to some code bugs, it did not really take effect. 
The main reason for the problem is that when the SearchFilter is copied deeply, only the params is copied, the sortBy and sortType attributes is omitted. The code show as follows:
{code:java}
Map<String, String> paramsCopy  = new HashMap<>(filter.getParams());
SearchFilter       searchFilter = new SearchFilter(paramsCopy);
{code}



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