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


This patch should be split into 2 patches.  
One for the Lexer changes to support complex values in the match func and the 
other for all other non-lexer work.

The changes to the lexer are correct but I would prefer to have this done in a 
generic manner.
I did some work to make your changes generic and have attached a patch for my 
QueryLexer chenges to the Jira as I don't think that I can attach them to the 
review.
All QueryLexer tests including your new tests pass with my changes but they 
need to be reviewed since I did this quickly to express my ideas.  That being 
said, I think that these changes are fairly complete but will need a little 
cleanup and attention.  

My changes basically introduce a ComplexValueOperatorHandler that is used for 
all relational functions.  I removed all logic specific to the 'match' function.
This new handler stores intermediate tokens in the scan context across handler 
invocations and then pushes these when the complex value is complete.
Some thought should be given to the new validateEndState() that I added.

I haven't yet reviewed the remainder of the patch.

- John Speidel


On Dec. 9, 2014, 2:58 p.m., Dmytro Sen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28851/
> -----------------------------------------------------------
> 
> (Updated Dec. 9, 2014, 2:58 p.m.)
> 
> 
> Review request for Ambari, John Speidel, Nate Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-8605
>     https://issues.apache.org/jira/browse/AMBARI-8605
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Stacks endpoint returns java exception for query predicate which use .matches 
> and logical OR, for example:
> /api/v1/stacks/HDP/versions/2.2/services/HIVE/configurations?fields=*&StackConfigurations/property_type.matches((.*USER.*)|(.*GROUP.*))
> 
> /api/v1/stacks/HDP/versions/2.2/services/HIVE/configurations?fields=*&(StackConfigurations/property_type.matches(.*USER.*)|StackConfigurations/property_type.matches(.*GROUP.*))
> 
> Regexp grouping with () doesn't work
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java
>  3940c34 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/predicate/Token.java 
> 3063f2b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/LocalUriInfo.java
>  9e927f6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ResultPostProcessorImpl.java
>  8d17846 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
>  4d0fb31 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/util/URLQueryUtils.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/predicate/QueryLexerTest.java
>  a587480 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/services/StacksServiceTest.java
>  268c008 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/util/URLQueryUtilsTest.java
>  PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/28851/diff/
> 
> 
> Testing
> -------
> 
> [INFO] Reactor Summary:
> [INFO] 
> [INFO] Ambari Main ....................................... SUCCESS [3.287s]
> [INFO] Apache Ambari Project POM ......................... SUCCESS [0.436s]
> [INFO] Ambari Web ........................................ SUCCESS [42.942s]
> [INFO] Ambari Views ...................................... SUCCESS [2.247s]
> [INFO] Ambari Admin View ................................. SUCCESS [10.312s]
> [INFO] Ambari Server ..................................... SUCCESS 
> [31:07.912s]
> [INFO] Ambari Agent ...................................... SUCCESS [6.565s]
> [INFO] Ambari Client ..................................... SUCCESS [0.042s]
> [INFO] Ambari Python Client .............................. SUCCESS [0.558s]
> [INFO] Ambari Groovy Client .............................. SUCCESS [10.233s]
> [INFO] Ambari Shell ...................................... SUCCESS [0.032s]
> [INFO] Ambari Python Shell ............................... SUCCESS [0.048s]
> [INFO] Ambari Groovy Shell ............................... SUCCESS [6.478s]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> 
> 
> Thanks,
> 
> Dmytro Sen
> 
>

Reply via email to