xuzifu666 commented on code in PR #4870:
URL: https://github.com/apache/calcite/pull/4870#discussion_r3045420940
##########
elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/AggregationAndSortTest.java:
##########
@@ -115,21 +115,16 @@ private static Connection createConnection() throws
SQLException {
return connection;
}
- /**
- * Currently the patterns like below will be converted to Search in range
- * which is not supported in elastic search adapter.
- * (val1 >= 10 and val1 <= 20)
- * (val1 <= 10 or val1 >=20)
- * (val1 <= 10) or (val1 > 15 and val1 <= 20)
- * So disable this test case until the translation from Search in range
- * to rang Query in ES is implemented.
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-4645">[CALCITE-4645]
+ * In Elasticsearch adapter, a range predicate should be translated to a
range query</a>.
*/
@Test void searchInRange() {
Assumptions.assumeTrue(Bug.CALCITE_4645_FIXED, "CALCITE-4645");
CalciteAssert.that()
.with(AggregationAndSortTest::createConnection)
.query("select count(*) from view where val1 >= 10 and val1 <=20")
- .returns("EXPR$0=1\n");
+ .returns("EXPR$0=0\n");
Review Comment:
test dataset is :
```
String doc1 = "{cat1:'a', cat2:'g', val1:1, cat4:'2018-01-01', cat5:1}";
String doc2 = "{cat2:'g', cat3:'y', val2:5, cat4:'2019-12-12',
cat6:'text1'}";
String doc3 = "{cat1:'b', cat2:'h', cat3:'z', cat5:2, val1:7, val2:42}";
```
val1 >= 10 and val1 <=20 only ```doc3```
So it is right in my view.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]