[
https://issues.apache.org/jira/browse/HIVE-13957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15319177#comment-15319177
]
Gopal V edited comment on HIVE-13957 at 6/7/16 7:27 PM:
--------------------------------------------------------
bq. derives the common type for the column and constants, and casts both
columns and constants to that whenever needed.
The cast is implicit right now - the UDF does the conversion behind the scenes.
Making the cast explicit actually would do the trick instead.
{{id in ('100000000', '200000000')}}
could be written in 2 ways.
{{cast(id as string) in (...)}} or {{id in (cast('100000000' as decimal(17,2)),
...)}}
Vectorization should have no trouble with either disambiguated forms, but
cannot deal with the actual lack of type conversions in the plan.
The interesting constraint is that all types inside the IN() clause have to be
identical, so that the conversion is exactly once - not like {{ id in (1.0,
'1.0', '1.00') }}
was (Author: gopalv):
bq. derives the common type for the column and constants, and casts both
columns and constants to that whenever needed.
The cast is implicit right now - the UDF does the conversion behind the scenes.
Making the cast explicit actually would do the trick instead.
{{id in ('100000000', '200000000')}}
could be written in 2 ways.
{{cast(id as string) in (...)}} or {{id in (cast('100000000' as decimal(17,2)),
...)}}
Vectorization should have no trouble with either disambiguated forms, but
cannot deal with the actual lack of type conversions in the plan.
> vectorized IN is inconsistent with non-vectorized (at least for decimal in
> (string))
> ------------------------------------------------------------------------------------
>
> Key: HIVE-13957
> URL: https://issues.apache.org/jira/browse/HIVE-13957
> Project: Hive
> Issue Type: Bug
> Reporter: Sergey Shelukhin
> Assignee: Sergey Shelukhin
> Attachments: HIVE-13957.patch, HIVE-13957.patch
>
>
> The cast is applied to the column in regular IN, but vectorized IN applies it
> to the IN() list
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)