You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2021/05/27 10:55:23 UTC

[GitHub] [calcite] yinchuanwang opened a new pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery

yinchuanwang opened a new pull request #2420:
URL: https://github.com/apache/calcite/pull/2420


   Currently the elastic search adapter does not support the 'SEARCH' call which usually comes from the 'in (a, b)'. This is the reason of the failure of test case "AggregationTest" in es adapter.  In this PR, I added the translation from 'SEARCH' call to termsQuery of es. Some test cases were also added in the "AggregationTest" to test the 'SEARCH' with different SQL types (char, varchar, number...)
   Please help review.


-- 
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:
users@infra.apache.org



[GitHub] [calcite] zinking commented on pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
zinking commented on pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#issuecomment-855548100


   LGTM


-- 
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:
users@infra.apache.org



[GitHub] [calcite] amaliujia commented on pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#issuecomment-856931614


   I was about to merge this PR but actually, can you add a test case for the IN range case and see what will happen? Ideally if this PR says that is not supported yet, maybe have a way to reject such query or at least don't let that run and give a wrong result?


-- 
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:
users@infra.apache.org



[GitHub] [calcite] amaliujia commented on a change in pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#discussion_r646815666



##########
File path: elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java
##########
@@ -179,6 +186,13 @@ private static boolean supportedRexCall(RexCall call) {
         default:
           return false;
         }
+      case INTERNAL:
+        switch (call.getKind()) {
+        case SEARCH:
+          return true;
+        default:
+          return false;

Review comment:
       Can you explain why SEARCH is true and others is false? Is the Search mapping to `IN` clause?




-- 
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:
users@infra.apache.org



[GitHub] [calcite] yinchuanwang commented on a change in pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
yinchuanwang commented on a change in pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#discussion_r646249334



##########
File path: elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/AggregationTest.java
##########
@@ -47,7 +46,6 @@
 /**
  * Testing Elasticsearch aggregation transformations.
  */
-@Disabled("RestClient often timeout in PR CI")

Review comment:
       Yes from my test. After adding the translation of 'SEARCH' RexCall, all the tests can pass. 




-- 
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:
users@infra.apache.org



[GitHub] [calcite] amaliujia commented on pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#issuecomment-857388296


   Thanks!


-- 
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:
users@infra.apache.org



[GitHub] [calcite] zinking commented on a change in pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
zinking commented on a change in pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#discussion_r646247909



##########
File path: elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/AggregationTest.java
##########
@@ -47,7 +46,6 @@
 /**
  * Testing Elasticsearch aggregation transformations.
  */
-@Disabled("RestClient often timeout in PR CI")

Review comment:
       so this comment is false statement ?




-- 
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:
users@infra.apache.org



[GitHub] [calcite] amaliujia commented on pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#issuecomment-857880110


   Fixex via https://github.com/apache/calcite/commit/3b74ea1e890cd3e14f95f0bc50809c31d3f8496e


-- 
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:
users@infra.apache.org



[GitHub] [calcite] amaliujia commented on a change in pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#discussion_r647672900



##########
File path: elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java
##########
@@ -179,6 +186,13 @@ private static boolean supportedRexCall(RexCall call) {
         default:
           return false;
         }
+      case INTERNAL:
+        switch (call.getKind()) {
+        case SEARCH:
+          return true;
+        default:
+          return false;

Review comment:
       Thanks for detailed explanation!




-- 
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:
users@infra.apache.org



[GitHub] [calcite] yinchuanwang commented on pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
yinchuanwang commented on pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#issuecomment-857420781


   > Thanks!
   
   Thanks for review, and I will open another PR to implement the translation of "Search In Range" soon.


-- 
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:
users@infra.apache.org



[GitHub] [calcite] yinchuanwang commented on a change in pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
yinchuanwang commented on a change in pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#discussion_r647115126



##########
File path: elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java
##########
@@ -179,6 +186,13 @@ private static boolean supportedRexCall(RexCall call) {
         default:
           return false;
         }
+      case INTERNAL:
+        switch (call.getKind()) {
+        case SEARCH:
+          return true;
+        default:
+          return false;

Review comment:
       The 'IN' clause is simplified from 'OR' into 'SEARCH'. Please refer to the method simplifyOrs(line 1867) of RexSimplify.java for the details. 
   Below is the logical plan change history of the test sql 'select count(*) from view where cat1 in ('a', 'b')'
   
   Original:
   `LogicalAggregate(group=[{}], EXPR$0=[COUNT()]): rowcount = 1.0, cumulative cost = {136.125 rows, 810.1 cpu, 0.0 io}, id = 14
     LogicalFilter(condition=[OR(=($0, 'a'), =($0, 'b'))]): rowcount = 25.0, cumulative cost = {135.0 rows, 810.1 cpu, 0.0 io}, id = 12
       LogicalProject(cat1=[ITEM($0, 'cat1')], cat2=[ITEM($0, 'cat2')], cat3=[ITEM($0, 'cat3')], cat4=[ITEM($0, 'cat4')], cat5=[ITEM($0, 'cat5')], val1=[ITEM($0, 'val1')], val2=[ITEM($0, 'val2')]): rowcount = 100.0, cumulative cost = {110.0 rows, 710.1 cpu, 0.0 io}, id = 11
         ElasticsearchTableScan(table=[[elastic, aggs]]): rowcount = 100.0, cumulative cost = {10.0 rows, 10.100000000000001 cpu, 0.0 io}, id = 10`
   
   Simplified:
   `LogicalAggregate(group=[{}], EXPR$0=[COUNT()]): rowcount = 2.5, cumulative cost = {2.8125 rows, 0.0 cpu, 0.0 io}, id = 32
     LogicalFilter(subset=[rel#31:RelSubset#2.NONE.[]], condition=[SEARCH($0, Sarg['a', 'b']:CHAR(1))]): rowcount = 25.0, cumulative cost = {25.0 rows, 100.0 cpu, 0.0 io}, id = 30
       LogicalProject(subset=[rel#29:RelSubset#1.NONE.[]], cat1=[ITEM($0, 'cat1')]): rowcount = 100.0, cumulative cost = {100.0 rows, 100.0 cpu, 0.0 io}, id = 28
         ElasticsearchTableScan(subset=[rel#27:RelSubset#0.ELASTICSEARCH.[]], table=[[elastic, aggs]]): rowcount = 100.0, cumulative cost = {10.0 rows, 10.100000000000001 cpu, 0.0 io}, id = 10
   `
   
   Best exp by the planner:
   `ElasticsearchToEnumerableConverter: rowcount = 1.0, cumulative cost = {12.7125 rows, 20.200000000000003 cpu, 0.0 io}, id = 84
     ElasticsearchAggregate(group=[{}], EXPR$0=[COUNT()]): rowcount = 1.0, cumulative cost = {12.6125 rows, 20.1 cpu, 0.0 io}, id = 83
       ElasticsearchFilter(condition=[SEARCH(ITEM($0, 'cat1'), Sarg['a', 'b']:CHAR(1))]): rowcount = 25.0, cumulative cost = {12.5 rows, 20.1 cpu, 0.0 io}, id = 82
         ElasticsearchTableScan(table=[[elastic, aggs]]): rowcount = 100.0, cumulative cost = {10.0 rows, 10.100000000000001 cpu, 0.0 io}, id = 10`
   
   The reason why only return true for 'SEARCH' is to minimize the impact of this change, so the other cases can go the old ways.  
   Actually there are three subtypes of SEARCH based on the included Sarg :
   1) Sarg isPoints. (map to In ('a', 'b', 'c'))
   2) Sarg isComplementedPoints. (map to Not in ('a', 'b', 'c'))
   3) Sarg is real Range set. (map to (f1 > 10 and f1 < 20) or (f1 > 30 and f1 < 40)).     
   
   The 1) and 2) cases can be translated to terms Query.
   And the 3) case should be translated to range Query.
   Currently only the 1) and 2) cases are supported, so I added a more strict filter condition. 
   
   The future work we can do is to support the 3) case to translate it to range Query of ES.




-- 
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:
users@infra.apache.org



[GitHub] [calcite] amaliujia closed pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
amaliujia closed pull request #2420:
URL: https://github.com/apache/calcite/pull/2420


   


-- 
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:
users@infra.apache.org



[GitHub] [calcite] amaliujia edited a comment on pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
amaliujia edited a comment on pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#issuecomment-856931614


   I was about to merge this PR but actually, can you add a test case for the IN range case and see what will happen? Ideally if this PR says that is not supported yet, that case will be rejected or at least don't let that run and give a wrong result?


-- 
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:
users@infra.apache.org



[GitHub] [calcite] yinchuanwang commented on a change in pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
yinchuanwang commented on a change in pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#discussion_r647115126



##########
File path: elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java
##########
@@ -179,6 +186,13 @@ private static boolean supportedRexCall(RexCall call) {
         default:
           return false;
         }
+      case INTERNAL:
+        switch (call.getKind()) {
+        case SEARCH:
+          return true;
+        default:
+          return false;

Review comment:
       The 'IN' clause is simplified from 'OR' into 'SEARCH'. Please refer to the method simplifyOrs(line 1867) of RexSimplify.java for the details. 
   Below is the logical plan change history of the test sql 'select count(*) from view where cat1 in ('a', 'b')'
   
   Original:
   `LogicalAggregate(group=[{}], EXPR$0=[COUNT()]): rowcount = 1.0, cumulative cost = {136.125 rows, 810.1 cpu, 0.0 io}, id = 14
     LogicalFilter(condition=[OR(=($0, 'a'), =($0, 'b'))]): rowcount = 25.0, cumulative cost = {135.0 rows, 810.1 cpu, 0.0 io}, id = 12
       LogicalProject(cat1=[ITEM($0, 'cat1')], cat2=[ITEM($0, 'cat2')], cat3=[ITEM($0, 'cat3')], cat4=[ITEM($0, 'cat4')], cat5=[ITEM($0, 'cat5')], val1=[ITEM($0, 'val1')], val2=[ITEM($0, 'val2')]): rowcount = 100.0, cumulative cost = {110.0 rows, 710.1 cpu, 0.0 io}, id = 11
         ElasticsearchTableScan(table=[[elastic, aggs]]): rowcount = 100.0, cumulative cost = {10.0 rows, 10.100000000000001 cpu, 0.0 io}, id = 10`
   
   Simplified:
   `LogicalAggregate(group=[{}], EXPR$0=[COUNT()]): rowcount = 2.5, cumulative cost = {2.8125 rows, 0.0 cpu, 0.0 io}, id = 32
     LogicalFilter(subset=[rel#31:RelSubset#2.NONE.[]], condition=[SEARCH($0, Sarg['a', 'b']:CHAR(1))]): rowcount = 25.0, cumulative cost = {25.0 rows, 100.0 cpu, 0.0 io}, id = 30
       LogicalProject(subset=[rel#29:RelSubset#1.NONE.[]], cat1=[ITEM($0, 'cat1')]): rowcount = 100.0, cumulative cost = {100.0 rows, 100.0 cpu, 0.0 io}, id = 28
         ElasticsearchTableScan(subset=[rel#27:RelSubset#0.ELASTICSEARCH.[]], table=[[elastic, aggs]]): rowcount = 100.0, cumulative cost = {10.0 rows, 10.100000000000001 cpu, 0.0 io}, id = 10
   `
   
   Best exp by the planner:
   `ElasticsearchToEnumerableConverter: rowcount = 1.0, cumulative cost = {12.7125 rows, 20.200000000000003 cpu, 0.0 io}, id = 84
     ElasticsearchAggregate(group=[{}], EXPR$0=[COUNT()]): rowcount = 1.0, cumulative cost = {12.6125 rows, 20.1 cpu, 0.0 io}, id = 83
       ElasticsearchFilter(condition=[SEARCH(ITEM($0, 'cat1'), Sarg['a', 'b']:CHAR(1))]): rowcount = 25.0, cumulative cost = {12.5 rows, 20.1 cpu, 0.0 io}, id = 82
         ElasticsearchTableScan(table=[[elastic, aggs]]): rowcount = 100.0, cumulative cost = {10.0 rows, 10.100000000000001 cpu, 0.0 io}, id = 10`
   
   The reason why only return true for 'SEARCH' is to minimize the impact of this change, so the other cases can go the old ways.  
   Actually there are three subtypes of SEARCH based on the included Sarg :
   1) Sarg isPoints. (map to In ('a', 'b', 'c'))
   2) Sarg isComplementedPoints. (map to Not in ('a', 'b', 'c'))
   3) Sarg is real Range set. (map to (f1 > 10 and f1 < 20) or (f1 > 30 and f1 < 40))
   The 1) and 2) cases can be translated to terms Query and the 3) case should be translated to range Query.
   Currently only the 1) and 2) cases are supported, so I added a more strict filter condition. 
   
   The future work we can do is to support the 3) case to translate it to range Query of ES.




-- 
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:
users@infra.apache.org



[GitHub] [calcite] amaliujia commented on pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#issuecomment-856138412


   Overall LGTM


-- 
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:
users@infra.apache.org



[GitHub] [calcite] amaliujia edited a comment on pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
amaliujia edited a comment on pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#issuecomment-857880110


   Fixed via https://github.com/apache/calcite/commit/3b74ea1e890cd3e14f95f0bc50809c31d3f8496e


-- 
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:
users@infra.apache.org



[GitHub] [calcite] yinchuanwang commented on a change in pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
yinchuanwang commented on a change in pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#discussion_r647115126



##########
File path: elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java
##########
@@ -179,6 +186,13 @@ private static boolean supportedRexCall(RexCall call) {
         default:
           return false;
         }
+      case INTERNAL:
+        switch (call.getKind()) {
+        case SEARCH:
+          return true;
+        default:
+          return false;

Review comment:
       The 'IN' clause is simplified from 'OR' into 'SEARCH'. Please refer to the method simplifyOrs(line 1867) of RexSimplify.java for the details. 
   Below is the logical plan change history of the test sql 'select count(*) from view where cat1 in ('a', 'b')'
   
   Original:
   `LogicalAggregate(group=[{}], EXPR$0=[COUNT()]): rowcount = 1.0, cumulative cost = {136.125 rows, 810.1 cpu, 0.0 io}, id = 14
     LogicalFilter(condition=[OR(=($0, 'a'), =($0, 'b'))]): rowcount = 25.0, cumulative cost = {135.0 rows, 810.1 cpu, 0.0 io}, id = 12
       LogicalProject(cat1=[ITEM($0, 'cat1')], cat2=[ITEM($0, 'cat2')], cat3=[ITEM($0, 'cat3')], cat4=[ITEM($0, 'cat4')], cat5=[ITEM($0, 'cat5')], val1=[ITEM($0, 'val1')], val2=[ITEM($0, 'val2')]): rowcount = 100.0, cumulative cost = {110.0 rows, 710.1 cpu, 0.0 io}, id = 11
         ElasticsearchTableScan(table=[[elastic, aggs]]): rowcount = 100.0, cumulative cost = {10.0 rows, 10.100000000000001 cpu, 0.0 io}, id = 10`
   
   Simplified:
   `LogicalAggregate(group=[{}], EXPR$0=[COUNT()]): rowcount = 2.5, cumulative cost = {2.8125 rows, 0.0 cpu, 0.0 io}, id = 32
     LogicalFilter(subset=[rel#31:RelSubset#2.NONE.[]], condition=[SEARCH($0, Sarg['a', 'b']:CHAR(1))]): rowcount = 25.0, cumulative cost = {25.0 rows, 100.0 cpu, 0.0 io}, id = 30
       LogicalProject(subset=[rel#29:RelSubset#1.NONE.[]], cat1=[ITEM($0, 'cat1')]): rowcount = 100.0, cumulative cost = {100.0 rows, 100.0 cpu, 0.0 io}, id = 28
         ElasticsearchTableScan(subset=[rel#27:RelSubset#0.ELASTICSEARCH.[]], table=[[elastic, aggs]]): rowcount = 100.0, cumulative cost = {10.0 rows, 10.100000000000001 cpu, 0.0 io}, id = 10
   `
   
   Best exp by the planner:
   `ElasticsearchToEnumerableConverter: rowcount = 1.0, cumulative cost = {12.7125 rows, 20.200000000000003 cpu, 0.0 io}, id = 84
     ElasticsearchAggregate(group=[{}], EXPR$0=[COUNT()]): rowcount = 1.0, cumulative cost = {12.6125 rows, 20.1 cpu, 0.0 io}, id = 83
       ElasticsearchFilter(condition=[SEARCH(ITEM($0, 'cat1'), Sarg['a', 'b']:CHAR(1))]): rowcount = 25.0, cumulative cost = {12.5 rows, 20.1 cpu, 0.0 io}, id = 82
         ElasticsearchTableScan(table=[[elastic, aggs]]): rowcount = 100.0, cumulative cost = {10.0 rows, 10.100000000000001 cpu, 0.0 io}, id = 10`
   
   The reason why only return true for 'SEARCH' is to minimize the impact of this change, so the other cases can go the old ways.  
   Actually there are three subtypes of SEARCH based on the included Sarg :
   1) Sarg isPoints. (map to In ('a', 'b', 'c'))
   2) Sarg isComplementedPoints. (map to Not in ('a', 'b', 'c'))
   3) Sarg is real Range set. (map to (f1 > 10 and f1 < 20) or (f1 > 30 and f1 < 40)).  
   The 1) and 2) cases can be translated to terms Query.
   And the 3) case should be translated to range Query.
   Currently only the 1) and 2) cases are supported, so I added a more strict filter condition. 
   
   The future work we can do is to support the 3) case to translate it to range Query of ES.




-- 
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:
users@infra.apache.org



[GitHub] [calcite] yinchuanwang commented on pull request #2420: [CALCITE-4606]Translate SEARCH rexnode to termsQuery in ElasticSearch Adapter

Posted by GitBox <gi...@apache.org>.
yinchuanwang commented on pull request #2420:
URL: https://github.com/apache/calcite/pull/2420#issuecomment-857297393


   I added a test case "SearchInRange" (line 124 of AggregationTest.java) which is disabled. Below is the exception output of this test case. Yes, it will say the "Unsupported call [SEARCH...]".  :) 
   
   ` org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:114)
   	at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:113)
   	at org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1130)
   	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:318)
   	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:215)
   	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:647)
   	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:513)
   	at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:483)
   	at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:249)
   	at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:623)
   	at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:675)
   	at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
   	... 66 more
   	Suppressed: org.apache.calcite.adapter.elasticsearch.PredicateAnalyzer$PredicateAnalyzerException: Unsupported call: [SEARCH(ITEM($0, 'val1'), Sarg[[10..20]])]
   		at org.apache.calcite.adapter.elasticsearch.PredicateAnalyzer$Visitor.visitCall(PredicateAnalyzer.java:238)
   		at org.apache.calcite.adapter.elasticsearch.PredicateAnalyzer$Visitor.visitCall(PredicateAnalyzer.java:127)
   		at org.apache.calcite.rex.RexCall.accept(RexCall.java:189)
   		at org.apache.calcite.adapter.elasticsearch.PredicateAnalyzer.analyze(PredicateAnalyzer.java:112)
   		at org.apache.calcite.adapter.elasticsearch.ElasticsearchFilter$PredicateAnalyzerTranslator.translateMatch(ElasticsearchFilter.java:102)
   		at org.apache.calcite.adapter.elasticsearch.ElasticsearchFilter.implement(ElasticsearchFilter.java:67)
   		at org.apache.calcite.adapter.elasticsearch.ElasticsearchRel$Implementor.visitChild(ElasticsearchRel.java:129)
   		at org.apache.calcite.adapter.elasticsearch.ElasticsearchAggregate.implement(ElasticsearchAggregate.java:128)
   		at org.apache.calcite.adapter.elasticsearch.ElasticsearchRel$Implementor.visitChild(ElasticsearchRel.java:129)
   		at org.apache.calcite.adapter.elasticsearch.ElasticsearchToEnumerableConverter.implement(ElasticsearchToEnumerableConverter.java:67)
   		at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:111)
   		... 77 more`


-- 
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:
users@infra.apache.org