Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-08-10 Thread chaitali

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

(Updated Aug. 10, 2020, 3 p.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":"159354180,159544260" .

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 (updated)
-

  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/9/

Changes: https://reviews.apache.org/r/72713/diff/8-9/


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,159596100"
  }
]
  },
  "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



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-08-10 Thread chaitali

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

(Updated Aug. 10, 2020, 2:44 p.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":"159354180,159544260" .

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 (updated)
-

  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/8/

Changes: https://reviews.apache.org/r/72713/diff/7-8/


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,159596100"
  }
]
  },
  "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



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-08-07 Thread Madhan Neethiraj

---
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)


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)


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)


"->" -> "<=="


- 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":"159354180,159544260" .
> 
> 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": 

Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-08-07 Thread chaitali

---
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":"159354180,159544260" .

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 (updated)
-

  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/

Changes: https://reviews.apache.org/r/72713/diff/6-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,159596100"
  }
]
  },
  "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



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-31 Thread Madhan Neethiraj

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


Ship it!




Ship It!

- Madhan Neethiraj


On July 31, 2020, 12:34 p.m., chaitali wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72713/
> ---
> 
> (Updated July 31, 2020, 12:34 p.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":"159354180,159544260" .
> 
> 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 
> c9a605355 
>   repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
> 5069d78c8 
>   
> repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
>  8e42d1700 
> 
> 
> Diff: https://reviews.apache.org/r/72713/diff/6/
> 
> 
> 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,159596100"
>   }
> ]
>   },
>   "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
> 
>



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-31 Thread chaitali

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

(Updated July 31, 2020, 12:34 p.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":"159354180,159544260" .

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 (updated)
-

  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 
c9a605355 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
5069d78c8 
  
repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
 8e42d1700 


Diff: https://reviews.apache.org/r/72713/diff/6/

Changes: https://reviews.apache.org/r/72713/diff/5-6/


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,159596100"
  }
]
  },
  "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



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-30 Thread Sarath Subramanian

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




repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Lines 52 (patched)


nit: unused import. revert



repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Lines 750 (patched)


escapeIndexQueryValue => rangeStartIndexQueryValue
escapeIndexQueryValue2 => rangeEndIndexQueryValue



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 902 (patched)


nit: remove new line



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Line 906 (original), 945 (patched)


nit: extra indent added from line 945-1005. revert


- Sarath Subramanian


On July 30, 2020, 7:34 a.m., chaitali wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72713/
> ---
> 
> (Updated July 30, 2020, 7:34 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":"159354180,159544260" .
> 
> 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 
> c9a605355 
>   repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
> 5069d78c8 
>   
> repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
>  8e42d1700 
> 
> 
> Diff: https://reviews.apache.org/r/72713/diff/5/
> 
> 
> 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,159596100"
>   }
> ]
>   },
>   "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
> 
>



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-30 Thread Madhan Neethiraj

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




repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Lines 634 (patched)


localDate => now



repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Lines 635 (patched)


Is 'ts' instance needed? only use is to call method valueOf(), which is a 
static method. I suggest to remove 'ts', and replace the calls with 
"Timestamp.valueOf()"



repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Lines 642 (patched)


The end time should be 'end of today'; not the current time. I suggest the 
following:

 final LocalDateTime now = LocalDateTime.now();
 final LocalDateTime startTime;
 final LocalDateTime endTime;

 switch (attrVal) {
   case "LAST_7_DAYS":
 startTime = 
now.minusDays(6).withHour(0).withMinute(0).withSecond(0).withNano(0);
 endTime   = startTime.plusDays(7).minusNanos(1);
   break;

   case "LAST_30_DAYS":
 startTime = 
now.minusDays(29).withHour(0).withMinute(0).withSecond(0).withNano(0);
 endTime   = startTime.plusDays(30).minusNanos(1);
   break;

   case "LAST_MONTH":
 startTime = 
now.minusMonths(1).withDayOfMonth(0).withHour(0).withMinute(0).withSecond(0).withNano(0);
 endTime   = startTime.plusMonths(1).minusNanos(1);
   break;

   case "THIS_MONTH":
 startTime = 
now.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
 endTime   = startTime.plusMonths(1).minusNanos(1);
   break;

   case "TODAY":
 startTime = now.withHour(0).withMinute(0).withSecond(0).withNano(0);
 endTime   = startTime.plusDays(1).minusNanos(1);
   break;

   case "YESTERDAY":
 startTime = 
now.minusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
 endTime   = startTime.plusDays(1).minusNanos(1);
   break;

   default:
 startTime = null;
 endTime   = null;
   break;
 }
 
 if (startTime == null || endTime == null) {
   // parse attrVal and update
 } else {
   attrVal = Timestamp.valueOf(startTime) + ATTRIBUTE_VALUE_DELIMITER + 
Timestamp.valueOf(endTime)
 }



repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Lines 739 (patched)


rangeStart and rangeEnd are referenced only inside the block at #747. 
Please move #739, #740 inside that block.



repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Lines 754 (patched)


Throw AtlasBaseException here when attrVal doesn't have expected value. 
This will be handled at #767 (prints a warn log)



repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Lines 848 (patched)


Even for single-line blocks, use { } - for consistency.



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 192 (patched)


add @Override annotation here as well



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 207 (patched)


"<-" -> "<=="



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 804 (patched)


Wouldn't this cause infinite recursion, as this calls itself? Shouldn't 
this call the existing method at #801 i.e. method that takes a single attrVal?



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Line 977 (original), 1019 (patched)


This change to constructor signature doesn't seem necessary. Please revert. 
Also, note that the new constructor at #1025 has same arguments, but in 
different order.



repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
Lines 319 (patched)


mark filtercriteriaDateRange() as private and static; move to end of this 
class.



repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
Lines 329 (patched)


attributeName is not set in filterCriteria? For completeness, please set to 
'createTime'. Also, consider populating filterCriteria before adding to params 
in #323.


- Madhan Neethiraj


On July 30, 2020, 2:34 p.m., chaitali wrote:
> 
> 

Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-30 Thread chaitali

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

(Updated July 30, 2020, 2:34 p.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":"159354180,159544260" .

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 (updated)
-

  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 
c9a605355 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
5069d78c8 
  
repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
 8e42d1700 


Diff: https://reviews.apache.org/r/72713/diff/5/

Changes: https://reviews.apache.org/r/72713/diff/4-5/


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,159596100"
  }
]
  },
  "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



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-30 Thread chaitali

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

(Updated July 30, 2020, 7:36 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 (updated)
---

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":"159354180,159544260" .

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 
c9a605355 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
5069d78c8 
  
repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
 8e42d1700 


Diff: https://reviews.apache.org/r/72713/diff/4/


Testing (updated)
---

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,159596100"
  }
]
  },
  "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



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-30 Thread Madhan Neethiraj

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




repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Line 526 (original), 534 (patched)


Block #534 - #557 is executed only for TIME_RANGE operator. This doesn't 
look right, given this block was executed for all operators before thisi patch. 
Please review and update.



repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
Lines 797 (patched)


Consider moving #797, #798, #807 - #815 under a  "case 
AtlasBaseTypeDef.ATLAS_TYPE_DATE:", like:

   case AtlasBaseTypeDef.ATLAS_TYPE_DATE:
 if (op == SearchParameters.Operator.TIME_RANGE && 
StringUtils.isNotEmpty(attrVal)) {
   String[] parts  = attrVal.split(ATTRIBUTE_VALUE_DELIMITER);
   String   rangeStart = parts.length > 0 ? parts[0];
   String   rangeEnd   = parts.length > 1 ? parts[1];
   
   attrValue  = StringUtils.isEmpty(rangeStart) ? null : 
Long.parseLong(rangeStart);
   attrValue2 = StringUtils.isEmpty(rangeEnd)   ? null : 
Long.parseLong(rangeEnd);
 } else {
   attrValue  = StringUtils.isEmpty(attrVal) ? null : 
Long.parseLong(attrVal);
 }



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 180 (patched)


getBETPredicate() => getInRangePredicate()



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 188 (patched)


'final' for argument is not useful, and is a distraction in reading the 
code. Please remove.



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 189 (patched)


Instead of returning null, I suggest:
  return generatePredicate(attrName, attrVal, attrVal, attrClass);



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 195 (patched)


add "attrVal2 == null" as well.



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Line 767 (original), 800 (patched)


Interfaces can have 'default' methods, so there is no need to change 
VertexAttributePredicateGenerator to an abstract class.



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 803 (patched)


Consider renaming the new method as generateInRangePredicate()



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 1008 (patched)


Mark 'value2' as final, and initialize to null in constructors at #1010 and 
#1016.



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 1021 (patched)


value  => rangeStart
value2 => rangeEnd



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 1075 (patched)


getBETPredicate() => getInRangePredicate()


- Madhan Neethiraj


On July 30, 2020, 5:57 a.m., chaitali wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72713/
> ---
> 
> (Updated July 30, 2020, 5:57 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 "BETWEEN" where all the below 
> 7 operators will be converted to BETWEEN 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":"159354180,159544260" .
> 
> 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 
>   

Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-29 Thread chaitali

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

(Updated July 30, 2020, 5:57 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 "BETWEEN" where all the below 7 
operators will be converted to BETWEEN 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":"159354180,159544260" .

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 (updated)
-

  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 
c9a605355 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
5069d78c8 
  
repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
 8e42d1700 


Diff: https://reviews.apache.org/r/72713/diff/4/

Changes: https://reviews.apache.org/r/72713/diff/3-4/


Testing
---

Tested with below json: 
eg : 
{
  "excludeDeletedEntities": true,
  "includeSubClassifications": true,
  "includeSubTypes": true,
  "includeClassificationAttributes": true,
  "entityFilters": {
"condition": "AND",
"criterion": [
  {
"attributeName": "__timestamp",
"operator": "THISMONTH",
"attributeValue": ""
  }
]
  },
  "tagFilters": null,
  "attributes": [
"__timestamp"
  ],
  "limit": 25,
  "offset": 0,
  "typeName": "Table",
  "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": "createTime",
"operator": "CUSTOM_RANGE",
"attributeValue": "159354180,159544260"
  }
]
  },
  "tagFilters": null,
  "attributes": [
"createTime"
  ],
  "limit": 25,
  "offset": 0,
  "typeName": "Table",
  "classification": null,
  "termName": null
}

* Added Test cases to check new processDateRange method functionality


Thanks,

chaitali



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-28 Thread Madhan Neethiraj

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




intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java
Lines 475 (patched)


- Consider renaming operator BETWEEN as TIME_RANGE
- I suggest to not model the time periods (LAST_7_DAYS, LAST_30_DAYS, .., 
CUSTOM_RANGE) as operators. Instead, these should be valid values for  operator 
TIME_RANGE.


- Madhan Neethiraj


On July 28, 2020, 5:30 p.m., chaitali wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72713/
> ---
> 
> (Updated July 28, 2020, 5:30 p.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 "BETWEEN" where all the below 
> 7 operators will be converted to BETWEEN 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":"159354180,159544260" .
> 
> 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 
> c9a605355 
>   repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
> 5069d78c8 
>   
> repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
>  8e42d1700 
> 
> 
> Diff: https://reviews.apache.org/r/72713/diff/3/
> 
> 
> Testing
> ---
> 
> Tested with below json: 
> eg : 
> {
>   "excludeDeletedEntities": true,
>   "includeSubClassifications": true,
>   "includeSubTypes": true,
>   "includeClassificationAttributes": true,
>   "entityFilters": {
> "condition": "AND",
> "criterion": [
>   {
> "attributeName": "__timestamp",
> "operator": "THISMONTH",
> "attributeValue": ""
>   }
> ]
>   },
>   "tagFilters": null,
>   "attributes": [
> "__timestamp"
>   ],
>   "limit": 25,
>   "offset": 0,
>   "typeName": "Table",
>   "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": "createTime",
> "operator": "CUSTOM_RANGE",
> "attributeValue": "159354180,159544260"
>   }
> ]
>   },
>   "tagFilters": null,
>   "attributes": [
> "createTime"
>   ],
>   "limit": 25,
>   "offset": 0,
>   "typeName": "Table",
>   "classification": null,
>   "termName": null
> }
> 
> * Added Test cases to check new processDateRange method functionality
> 
> 
> Thanks,
> 
> chaitali
> 
>



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-28 Thread chaitali

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

(Updated July 28, 2020, 5:25 p.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 "BETWEEN" where all the below 7 
operators will be converted to BETWEEN 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":"159354180,159544260" .

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 (updated)
-

  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 
c9a605355 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
5069d78c8 
  
repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
 8e42d1700 


Diff: https://reviews.apache.org/r/72713/diff/2/

Changes: https://reviews.apache.org/r/72713/diff/1-2/


Testing
---

Tested with below json: 
eg : 
{
  "excludeDeletedEntities": true,
  "includeSubClassifications": true,
  "includeSubTypes": true,
  "includeClassificationAttributes": true,
  "entityFilters": {
"condition": "AND",
"criterion": [
  {
"attributeName": "__timestamp",
"operator": "THISMONTH",
"attributeValue": ""
  }
]
  },
  "tagFilters": null,
  "attributes": [
"__timestamp"
  ],
  "limit": 25,
  "offset": 0,
  "typeName": "Table",
  "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": "createTime",
"operator": "CUSTOM_RANGE",
"attributeValue": "159354180,159544260"
  }
]
  },
  "tagFilters": null,
  "attributes": [
"createTime"
  ],
  "limit": 25,
  "offset": 0,
  "typeName": "Table",
  "classification": null,
  "termName": null
}

* Added Test cases to check new processDateRange method functionality


Thanks,

chaitali



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-28 Thread chaitali

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

(Updated July 28, 2020, 5:30 p.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 "BETWEEN" where all the below 7 
operators will be converted to BETWEEN 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":"159354180,159544260" .

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 (updated)
-

  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 
c9a605355 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
5069d78c8 
  
repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
 8e42d1700 


Diff: https://reviews.apache.org/r/72713/diff/3/

Changes: https://reviews.apache.org/r/72713/diff/2-3/


Testing
---

Tested with below json: 
eg : 
{
  "excludeDeletedEntities": true,
  "includeSubClassifications": true,
  "includeSubTypes": true,
  "includeClassificationAttributes": true,
  "entityFilters": {
"condition": "AND",
"criterion": [
  {
"attributeName": "__timestamp",
"operator": "THISMONTH",
"attributeValue": ""
  }
]
  },
  "tagFilters": null,
  "attributes": [
"__timestamp"
  ],
  "limit": 25,
  "offset": 0,
  "typeName": "Table",
  "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": "createTime",
"operator": "CUSTOM_RANGE",
"attributeValue": "159354180,159544260"
  }
]
  },
  "tagFilters": null,
  "attributes": [
"createTime"
  ],
  "limit": 25,
  "offset": 0,
  "typeName": "Table",
  "classification": null,
  "termName": null
}

* Added Test cases to check new processDateRange method functionality


Thanks,

chaitali



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-28 Thread chaitali

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

(Updated July 28, 2020, 1:58 p.m.)


Review request for atlas, Jayendra Parab, Madhan Neethiraj, Nixon Rodrigues, 
and Sarath Subramanian.


Changes
---

Added description


Bugs: ATLAS-3892
https://issues.apache.org/jira/browse/ATLAS-3892


Repository: atlas


Description (updated)
---

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 "BETWEEN" where all the below 7 
operators will be converted to BETWEEN 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":"159354180,159544260" .

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 
c9a605355 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
5069d78c8 
  
repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
 8e42d1700 


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


Testing
---

Tested with below json: 
eg : 
{
  "excludeDeletedEntities": true,
  "includeSubClassifications": true,
  "includeSubTypes": true,
  "includeClassificationAttributes": true,
  "entityFilters": {
"condition": "AND",
"criterion": [
  {
"attributeName": "__timestamp",
"operator": "THISMONTH",
"attributeValue": ""
  }
]
  },
  "tagFilters": null,
  "attributes": [
"__timestamp"
  ],
  "limit": 25,
  "offset": 0,
  "typeName": "Table",
  "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": "createTime",
"operator": "CUSTOM_RANGE",
"attributeValue": "159354180,159544260"
  }
]
  },
  "tagFilters": null,
  "attributes": [
"createTime"
  ],
  "limit": 25,
  "offset": 0,
  "typeName": "Table",
  "classification": null,
  "termName": null
}

* Added Test cases to check new processDateRange method functionality


Thanks,

chaitali



Re: Review Request 72713: ATLAS-3892 : Basic search enhanced Feature - Search history

2020-07-28 Thread chaitali

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

(Updated July 28, 2020, 1:56 p.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 (updated)
---

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 "BETWEEN" where all the below 7 
operators will be converted to BETWEEN 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":"159354180,159544260".

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 
c9a605355 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
5069d78c8 
  
repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
 8e42d1700 


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


Testing (updated)
---

Tested with below json: 
eg : 
{
  "excludeDeletedEntities": true,
  "includeSubClassifications": true,
  "includeSubTypes": true,
  "includeClassificationAttributes": true,
  "entityFilters": {
"condition": "AND",
"criterion": [
  {
"attributeName": "__timestamp",
"operator": "THISMONTH",
"attributeValue": ""
  }
]
  },
  "tagFilters": null,
  "attributes": [
"__timestamp"
  ],
  "limit": 25,
  "offset": 0,
  "typeName": "Table",
  "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": "createTime",
"operator": "CUSTOM_RANGE",
"attributeValue": "159354180,159544260"
  }
]
  },
  "tagFilters": null,
  "attributes": [
"createTime"
  ],
  "limit": 25,
  "offset": 0,
  "typeName": "Table",
  "classification": null,
  "termName": null
}

* Added Test cases to check new processDateRange method functionality


Thanks,

chaitali