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


Fix it, then Ship it!





repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Lines 654 (patched)
<https://reviews.apache.org/r/72713/#comment310542>

    I suggest to have endTime for THIS_MONTH as:
      endTime   = startTime.plusMonths(1).minusNanos(1);



repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Lines 667 (patched)
<https://reviews.apache.org/r/72713/#comment310546>

    I suggest to support following time-range as well:
    
    •   This quarter
        startTime = now.minusMonths((now.getMonth() - 1) % 
3).withHour(0).withMinute(0).withSecond(0).withNano(0);
        endTime   = startTime.plusMonths(3).minusNanos(1);
    •   This year
        startTime = 
now.withMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
        endTime   = startTime.plusYears(1).minusNanos(1);
    •   Last quarter
        startTime = now.minusMonths((now.getMonth() - 1) % 
3).minusMonths(3).withHour(0).withMinute(0).withSecond(0).withNano(0);
        endTime   = startTime.plusMonths(3).minusNanos(1);
    •   Last year
        startTime = 
now.minusYears(1).withMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
        endTime   = startTime.plusYears(1).minusNanos(1);
    •   Last 3 months
        startTime = 
now.minusMonths(3).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
        endTime   = startTime.plusMonths(3).minusNanos(1);
    •   Last 6 months
        startTime = 
now.minusMonths(6).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
        endTime   = startTime.plusMonths(6).minusNanos(1);
    •   Last 12 months
        startTime = 
now.minusMonths(12).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
        endTime   = startTime.plusMonths(12).minusNanos(1);



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 210 (patched)
<https://reviews.apache.org/r/72713/#comment310544>

    "->" -> "<=="


- Madhan Neethiraj


On Aug. 7, 2020, 9:32 a.m., chaitali wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72713/
> -----------------------------------------------------------
> 
> (Updated Aug. 7, 2020, 9:32 a.m.)
> 
> 
> Review request for atlas, Jayendra Parab, Madhan Neethiraj, Nixon Rodrigues, 
> and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3892
>     https://issues.apache.org/jira/browse/ATLAS-3892
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> 1.This patch implements the search history feature where from UI we will 
> receive below filters.
> 2.In backend we have introduced a new operator "TIME_RANGE" where all the 
> below 7 attribute values will have TIME_RANGE operator.
> 3.There will be a slight change in the JSON where previously we were passing 
> the Attribute value in Search parameters from the UI but for below filters   
> we will not pass any attributeValue except for "custom range" filter we 
> provide attribute value 
>   for eg ;"attributeValue":"1593541800000,1595442600000" .
> 
> New 7 filters :
> 
> 1.last 7 days.
> 2.Last month.
> 3.Last 30 days.
> 4.Today.
> 5.Yesterday.
> 6.Custom Range.
> 7.This Month.
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/repository/Constants.java a71787bc0 
>   intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
> fcc4494f2 
>   repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
> c5e3d6f0b 
>   repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
> cf158cd99 
>   
> repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
>  7b40c2184 
> 
> 
> Diff: https://reviews.apache.org/r/72713/diff/7/
> 
> 
> Testing
> -------
> 
> Tested with below json: 
> eg : 
> {
>   "excludeDeletedEntities": true,
>   "includeSubClassifications": true,
>   "includeSubTypes": true,
>   "includeClassificationAttributes": true,
>   "entityFilters": {
>     "condition": "AND",
>     "criterion": [
>       {
>         "attributeName": "__timestamp",
>               "operator": "TIME_RANGE",
>               "attributeValue": "YESTERDAY"
>       }
>     ]
>   },
>   "tagFilters": null,
>   "attributes": [
>     "__timestamp"
>   ],
>   "limit": 25,
>   "offset": 0,
>   "typeName": "hdfs_path",
>   "classification": null,
>   "termName": null
> }
> eg: Only For custom range filter we provide attribute value.
> {
>   "excludeDeletedEntities": true,
>   "includeSubClassifications": true,
>   "includeSubTypes": true,
>   "includeClassificationAttributes": true,
>   "entityFilters": {
>     "condition": "AND",
>     "criterion": [
>       {
>         "attributeName": "__timestamp",
>               "operator": "TIME_RANGE",
>               "attributeValue": "1595956315473,1595961000000"
>       }
>     ]
>   },
>   "tagFilters": null,
>   "attributes": [
>     "__timestamp"
>   ],
>   "limit": 25,
>   "offset": 0,
>   "typeName": "Table",
>   "classification": null,
>   "termName": null
> }
> 
> * Added Test cases to check new processDateRange method functionality
> 
> 
> Thanks,
> 
> chaitali
> 
>

Reply via email to