-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73883/
-----------------------------------------------------------
(Updated March 4, 2022, 10:35 a.m.)
Review request for atlas, Jayendra Parab, Mandar Ambawane, and Pinal Shah.
Bugs: ATLAS-4560
https://issues.apache.org/jira/browse/ATLAS-4560
Repository: atlas
Description
-------
Root cause :
There is a check in the code, if the query contains 'limit' keyword and does
not contain 'offset' then add 'offset 0' to the query.
eg : where name="test_column" limit 6, the updated query would be, where
name="test_column" limit 6 offset 0
In the query, where name="test_limit"
Since the query contains 'limit' word, offset 0 is added to the query without
the 'limit' keyword.
As per the grammar, there has to be 'limit' before 'offset', hence the error.
Solution:
It is not required to have offset when limit is specified.so the check is not
required.
Removed the above mentioned check, so no offset is added when there is 'limit'
word in the query.
Search works as expected with just limit specified
If the query does not contain 'limit', default limit value is used.
Diffs
-----
repository/src/main/java/org/apache/atlas/query/executors/TraversalBasedExecutor.java
ecd82e3fd
repository/src/test/java/org/apache/atlas/BasicTestSetup.java a1d7b62a5
repository/src/test/java/org/apache/atlas/discovery/AtlasDiscoveryServiceTest.java
8c257d866
repository/src/test/java/org/apache/atlas/query/BaseDSLComposer.java
419050ec8
repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java 74cc4e0a2
repository/src/test/java/org/apache/atlas/query/TraversalComposerTest.java
60645771d
Diff: https://reviews.apache.org/r/73883/diff/3/
Testing
-------
1. created hive table with column test_limit and did basic search and advanced
search
2. created hive table with 'limit' in name and did basic search and advanced
search
3. used quick search entity types to create entities with limit in their name
and searched for them
4. Tested for 'limit' string in classifications and glossaries.
5. Small sanity in basic search and advanced search.
Precommit :
https://ci-builds.apache.org/job/Atlas/job/PreCommit-ATLAS-Build-Test/1052/console
Thanks,
Snehal Ambavkar