Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Invalid
-
3.1.0
-
None
-
None
Description
Reproducible case:
create table t1 (c1 int, c2 int, c3 int); select get_splits("select c2, count(distinct c3) from t1 group by c2 having count(distinct c3) > 1",0);
Error:
Error: java.io.IOException: org.apache.hadoop.hive.ql.optimizer.calcite.CalciteSemanticException: Distinct without an aggregation. (state=,code=0)
This happens because calcite does not understand the query "select c2, count(distinct c3) from t1 group by c2 having count(distinct c3) > 1" and throws calciteSemanticException
If this query is run directly via beeline, hiveserver2 catches this exception and re-analyzes the query by turning off the cbo.
This retrying mechanism is missing in GetSplits UDF.