-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Open
Labels
:Analytics/SQLSQL queryingSQL querying>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Description
Currently the HAVING clause translation takes into account only aggregations - however when dealing with subqueries, fields can be used as well:
SELECT * FROM (
SELECT languages, COUNT(*) AS c FROM test_emp
)
WHERE c > 0 OR languages IS NOT NULL
Due to the disjunction languages > 0 cannot be pushed down and the execution will fail due to the generated script being incorrect:
"source" : "InternalQlScriptUtils.nullSafeFilter(InternalQlScriptUtils.or(InternalQlScriptUtils.nullSafeFilter(InternalSqlScriptUtils.gt(params.a0,params.v0)),InternalQlScriptUtils.nullSafeFilter(InternalQlScriptUtils.isNotNull(InternalQlScriptUtils.docValue(doc,params.v2)))",
Metadata
Metadata
Assignees
Labels
:Analytics/SQLSQL queryingSQL querying>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)