dbwong commented on a change in pull request #830:
URL: https://github.com/apache/phoenix/pull/830#discussion_r455504618
##########
File path:
phoenix-core/src/test/java/org/apache/phoenix/compile/RVCOffsetCompilerTest.java
##########
@@ -148,12 +153,82 @@ public void buildListOfRowKeyColumnExpressionsIndexTest()
throws Exception {
expressions.add(expression1);
expressions.add(expression2);
+ AndExpression expression = mock(AndExpression.class);
+ Mockito.when(expression.getChildren()).thenReturn(expressions);
+
+ List<RowKeyColumnExpression>
+ result =
+ offsetCompiler.buildListOfRowKeyColumnExpressions(expression,
true);
+
+ assertEquals(2,result.size());
+ assertEquals(rvc1,result.get(0));
+ assertEquals(rvc2,result.get(1));
+ }
+
+ @Test
+ public void buildListOfRowKeyColumnExpressionsSingleNodeComparisonTest()
throws Exception {
+ List<Expression> expressions = new ArrayList<>();
+
+ RowKeyColumnExpression rvc1 = new RowKeyColumnExpression();
+ RowKeyColumnExpression rvc2 = new RowKeyColumnExpression();
Review comment:
will do
##########
File path:
phoenix-core/src/test/java/org/apache/phoenix/compile/RVCOffsetCompilerTest.java
##########
@@ -148,12 +153,82 @@ public void buildListOfRowKeyColumnExpressionsIndexTest()
throws Exception {
expressions.add(expression1);
expressions.add(expression2);
+ AndExpression expression = mock(AndExpression.class);
+ Mockito.when(expression.getChildren()).thenReturn(expressions);
+
+ List<RowKeyColumnExpression>
+ result =
+ offsetCompiler.buildListOfRowKeyColumnExpressions(expression,
true);
+
+ assertEquals(2,result.size());
+ assertEquals(rvc1,result.get(0));
+ assertEquals(rvc2,result.get(1));
+ }
+
+ @Test
+ public void buildListOfRowKeyColumnExpressionsSingleNodeComparisonTest()
throws Exception {
+ List<Expression> expressions = new ArrayList<>();
+
+ RowKeyColumnExpression rvc1 = new RowKeyColumnExpression();
+ RowKeyColumnExpression rvc2 = new RowKeyColumnExpression();
+
+ ComparisonExpression expression1 = mock(ComparisonExpression.class);
+
+
Mockito.when(expression1.getChildren()).thenReturn(Lists.<Expression>newArrayList(rvc1));
+
+ List<RowKeyColumnExpression>
+ result =
+ offsetCompiler.buildListOfRowKeyColumnExpressions(expression1,
false);
+
+ assertEquals(1,result.size());
+ assertEquals(rvc1,result.get(0));
+ }
+
+ @Test
+ public void buildListOfRowKeyColumnExpressionsSingleNodeIsNullTest()
throws Exception {
+ List<Expression> expressions = new ArrayList<>();
+
+ RowKeyColumnExpression rvc1 = new RowKeyColumnExpression();
+ RowKeyColumnExpression rvc2 = new RowKeyColumnExpression();
+
+ IsNullExpression expression1 = mock(IsNullExpression.class);
Review comment:
will do
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]