[
https://issues.apache.org/jira/browse/HIVE-24666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17284333#comment-17284333
]
Gopal Vijayaraghavan commented on HIVE-24666:
---------------------------------------------
The new patch looks really good. You've done exactly what I would have with the
cast expr impl.
Looks like this patch changes the non-vectorized code as well. I can see what
you did in SemanticAnalyze & TypeCheckProc, but that code needs a comment (the
complex type "is not null" + the cast for the other types).
For example, if I saw this below change in a git bisect check, I would
immediately look to see what removed the Filter operator (in context of this
patch, that is pretty clear - but reading the SemanticAnalyzer is hard enough
as it is).
{code}
--- ql/src/test/results/clientpositive/llap/annotate_stats_filter.q.out
+++ ql/src/test/results/clientpositive/llap/annotate_stats_filter.q.out
@@ -375,12 +375,10 @@ STAGE PLANS:
Processor Tree:
TableScan
alias: loc_orc
- Filter Operator
- predicate: 'foo' (type: string)
- Select Operator
- expressions: state (type: string), locid (type: int), zip (type:
bigint), year (type: int)
- outputColumnNames: _col0, _col1, _col2, _col3
- ListSink
+ Select Operator
+ expressions: state (type: string), locid (type: int), zip (type:
bigint), year (type: int)
+ outputColumnNames: _col0, _col1, _col2, _col3
+ ListSink
{code}
> Vectorized UDFToBoolean may unable to filter rows if input is string
> --------------------------------------------------------------------
>
> Key: HIVE-24666
> URL: https://issues.apache.org/jira/browse/HIVE-24666
> Project: Hive
> Issue Type: Bug
> Components: Vectorization
> Reporter: Zhihua Deng
> Assignee: Zhihua Deng
> Priority: Minor
> Labels: pull-request-available
> Attachments: HIVE-24666.2.patch
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> If we use cast boolean in where conditions to filter rows, in vectorization
> execution the filter is unable to filter rows, step to reproduce:
> {code:java}
> create table vtb (key string, value string);
> insert into table vtb values('0', 'val0'), ('false', 'valfalse'),('off',
> 'valoff'),('no','valno'),('vk', 'valvk');
> select distinct value from vtb where cast(key as boolean); {code}
> It's seems we don't generate a SelectColumnIsTrue to filter the rows if the
> casted type is string:
>
> https://github.com/apache/hive/blob/ff6f3565e50148b7bcfbcf19b970379f2bd59290/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java#L2995-L2996
--
This message was sent by Atlassian Jira
(v8.3.4#803005)