You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Brahma Reddy Battula (Jira)" <ji...@apache.org> on 2022/12/01 09:18:00 UTC
[jira] [Updated] (HIVE-20277) Vectorization: Case expressions that return BOOLEAN are not supported for FILTER
[ https://issues.apache.org/jira/browse/HIVE-20277?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brahma Reddy Battula updated HIVE-20277:
----------------------------------------
Labels: Branch3Candidate hive-3.2.0-candidate (was: Branch3Candidate)
> Vectorization: Case expressions that return BOOLEAN are not supported for FILTER
> --------------------------------------------------------------------------------
>
> Key: HIVE-20277
> URL: https://issues.apache.org/jira/browse/HIVE-20277
> Project: Hive
> Issue Type: Bug
> Components: Vectorization
> Affects Versions: 4.0.0
> Reporter: Gopal Vijayaraghavan
> Assignee: Matt McCline
> Priority: Major
> Labels: Branch3Candidate, hive-3.2.0-candidate
> Fix For: 4.0.0-alpha-1
>
> Attachments: HIVE-20277.02.patch, HIVE-20277.03.patch, HIVE-20277.04.patch, HIVE-20277.WIP.01.patch
>
>
> In cases like Query89, the vertex with the filter is not vectorized.
> {code}
> Filter Operator
> predicate: CASE WHEN ((avg_window_0 <> 0.0D)) THEN (((abs((_col6 - avg_window_0)) / avg_window_0) > 0.1D)) ELSE (null) END (type: boolean)
> {code}
> {code}
> Reducer 3
> Execution mode: llap
> Reduce Vectorization:
> enabled: true
> enableConditionsMet: hive.vectorized.execution.reduce.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true
> notVectorizedReason: FILTER operator: Unexpected hive type name void
> vectorized: false
> {code}
> The query specifically has
> {code}
> where case when (avg_monthly_sales <> 0) then (abs(sum_sales - avg_monthly_sales) / avg_monthly_sales) else null end > 0.1
> {code}
> while rewriting it to
> {code}
> where case when (avg_monthly_sales <> 0) then (abs(sum_sales - avg_monthly_sales) / avg_monthly_sales) > 0.1 else false end
> {code}
> does vectorize into
> {code}
> Filter Operator
> Filter Vectorization:
> className: VectorFilterOperator
> native: true
> predicateExpression: SelectColumnIsTrue(col 12:boolean)(children: VectorUDFAdaptor(CASE WHEN ((avg_window_0 <> 0.0D)) THEN (((abs((_col6 - avg_window_0)) / avg_window_0) > 0.1D)) ELSE (false) END)(children: DoubleColNotEqualDoubleScalar(col 7:double, val 0.0) -> 8:boolean, DoubleColGreaterDoubleScalar(col 9:double, val 0.1)(children: DoubleColDivideDoubleColumn(col 10:double, col 7:double)(children: FuncAbsDoubleToDouble(col 9:double)(children: DoubleColSubtractDoubleColumn(col 6:double, col 7:double) -> 9:double) -> 10:double) -> 9:double) -> 11:boolean) -> 12:boolean)
> predicate: CASE WHEN ((avg_window_0 <> 0.0D)) THEN (((abs((_col6 - avg_window_0)) / avg_window_0) > 0.1D)) ELSE (false) END (type: boolean)
> Statistics: Num rows: 11 Data size: 5291 Basic stats: COMPLETE Column stats: COMPLETE
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)