You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Jacky Yin (Jira)" <ji...@apache.org> on 2021/05/13 09:12:00 UTC
[jira] [Created] (CALCITE-4606) Test case "countStar" throws
exception in AggregationTest of elastic-search adapter
Jacky Yin created CALCITE-4606:
----------------------------------
Summary: Test case "countStar" throws exception in AggregationTest of elastic-search adapter
Key: CALCITE-4606
URL: https://issues.apache.org/jira/browse/CALCITE-4606
Project: Calcite
Issue Type: Bug
Components: elasticsearch-adapter
Affects Versions: 1.26.0
Reporter: Jacky Yin
Currently, the "AggregationTest" of elastic-search adapter is disabled. If we enable it, the test case "countStar" will throw exception as below. It is because that the filter "cat1 in ('a', 'b')" will be simplified from "[OR(=($0, 'a'), =($0, 'b'))]" to "[SEARCH(ITEM($0, 'cat1'), Sarg['a', 'b']:CHAR(1))]" which is not supported by PredicateAnalyzerTranslator of ElasticSearchFilter.
Error while executing SQL "select count(*) from view where cat1 in ('a', 'b')": Unable to implement ElasticsearchToEnumerableConverter: rowcount = 1.0, cumulative cost = \{12.7125 rows, 20.200000000000003 cpu, 0.0 io}, id = 262
ElasticsearchAggregate(group=[{}], EXPR$0=[COUNT()]): rowcount = 1.0, cumulative cost = \{12.6125 rows, 20.1 cpu, 0.0 io}, id = 260
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 = 258
ElasticsearchTableScan(table=[[elastic, aggs]]): rowcount = 100.0, cumulative cost = \{10.0 rows, 10.100000000000001 cpu, 0.0 io}, id = 182
java.sql.SQLException: Error while executing SQL "select count(*) from view where cat1 in ('a', 'b')": Unable to implement ElasticsearchToEnumerableConverter: rowcount = 1.0, cumulative cost = \{12.7125 rows, 20.200000000000003 cpu, 0.0 io}, id = 262
ElasticsearchAggregate(group=[{}], EXPR$0=[COUNT()]): rowcount = 1.0, cumulative cost = \{12.6125 rows, 20.1 cpu, 0.0 io}, id = 260
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 = 258
ElasticsearchTableScan(table=[[elastic, aggs]]): rowcount = 100.0, cumulative cost = \{10.0 rows, 10.100000000000001 cpu, 0.0 io}, id = 182
--
This message was sent by Atlassian Jira
(v8.3.4#803005)