Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
create temporary table foo (x int) ; insert into foo values(1),(2),(3),(4),(5); set hive.explain.user=false; explain vectorization detail select count(case when (x=1 or false) then 1 else 0 end ) from foo
| Group By Operator | | aggregations: count(CASE WHEN (((x = 1) or false)) THEN (1) ELSE (0) END) | | Group By Vectorization: | | aggregators: VectorUDAFCount(IfExprLongScalarLongScalar(col 3:boolean, val 1, val 0)(children: VectorUDFAdaptor(((x = 1) or false))(children: LongColEqualLongScalar(col 0:int, val 1) -> 2:boolean) -> 3:boolean) -> 4:int) -> bigint | | className: VectorGroupByOperator |
The pass-through Calcite fixes this.
| OPTIMIZED SQL: SELECT COUNT(CASE WHEN `x` = 1 THEN 1 ELSE 0 END) AS `$f0` |
| FROM `default`.`foo`
explain vectorization detail select count(true and false and true); | Group By Operator | | aggregations: count((true and false and true)) |