Commit ff605a20 by apoorvnaik

ATLAS-2468: Basic search issue with numeric NEQ within OR clause

parent 860258d3
...@@ -46,7 +46,15 @@ import org.slf4j.LoggerFactory; ...@@ -46,7 +46,15 @@ import org.slf4j.LoggerFactory;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import static org.apache.atlas.util.SearchPredicateUtil.*; import static org.apache.atlas.util.SearchPredicateUtil.*;
...@@ -87,7 +95,7 @@ public abstract class SearchProcessor { ...@@ -87,7 +95,7 @@ public abstract class SearchProcessor {
OPERATOR_MAP.put(SearchParameters.Operator.EQ, INDEX_SEARCH_PREFIX + "\"%s\": %s"); OPERATOR_MAP.put(SearchParameters.Operator.EQ, INDEX_SEARCH_PREFIX + "\"%s\": %s");
OPERATOR_PREDICATE_MAP.put(SearchParameters.Operator.EQ, getEQPredicateGenerator()); OPERATOR_PREDICATE_MAP.put(SearchParameters.Operator.EQ, getEQPredicateGenerator());
OPERATOR_MAP.put(SearchParameters.Operator.NEQ, "-" + INDEX_SEARCH_PREFIX + "\"%s\": %s"); OPERATOR_MAP.put(SearchParameters.Operator.NEQ, "(*:* -" + INDEX_SEARCH_PREFIX + "\"%s\": %s)");
OPERATOR_PREDICATE_MAP.put(SearchParameters.Operator.NEQ, getNEQPredicateGenerator()); OPERATOR_PREDICATE_MAP.put(SearchParameters.Operator.NEQ, getNEQPredicateGenerator());
OPERATOR_MAP.put(SearchParameters.Operator.IN, INDEX_SEARCH_PREFIX + "\"%s\": (%s)"); // this should be a list of quoted strings OPERATOR_MAP.put(SearchParameters.Operator.IN, INDEX_SEARCH_PREFIX + "\"%s\": (%s)"); // this should be a list of quoted strings
......
...@@ -308,5 +308,37 @@ ...@@ -308,5 +308,37 @@
] ]
}, },
"expectedCount": 3 "expectedCount": 3
},
{
"testDescription": "hive_table contains testtable or retentionSize != 0",
"searchParameters": {
"typeName": "hive_table",
"excludeDeletedEntities": true,
"classification": "",
"query": "",
"limit": 25,
"offset": 0,
"entityFilters": {
"condition" : "OR",
"criterion" : [
{
"attributeName": "name",
"operator": "contains",
"attributeValue": "testtable"
},
{
"attributeName": "retention",
"operator": "neq",
"attributeValue": "0"
}
]
},
"tagFilters": null,
"attributes": [
""
]
},
"expectedCount": 3
} }
] ]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment