[
https://issues.apache.org/jira/browse/HIVE-27264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17712282#comment-17712282
]
Krisztian Kasa commented on HIVE-27264:
---------------------------------------
During planing \{{HivePointLookupOptimizerRule}} receives an expression
{code}
AND(IN($0, _UTF-16LE'AAA111':VARCHAR(30) CHARACTER SET "UTF-16LE",
_UTF-16LE'BBB222':VARCHAR(30) CHARACTER SET "UTF-16LE"), IN($0,
_UTF-16LE'AAA111':VARCHAR(14) CHARACTER SET "UTF-16LE",
_UTF-16LE'BBB222':VARCHAR(14) CHARACTER SET "UTF-16LE"))
{code}
The {{IN}} expressions has the same literals so the conjunction could be
simplified to only one {{IN}} expression but the literals has different
precision so they are not treated equal when collecting them for constructing
the new {{IN}} expression.
> Literals in conjunction of two in expression are considered not equals if
> type precision is different
> -----------------------------------------------------------------------------------------------------
>
> Key: HIVE-27264
> URL: https://issues.apache.org/jira/browse/HIVE-27264
> Project: Hive
> Issue Type: Bug
> Components: CBO
> Reporter: Krisztian Kasa
> Assignee: Krisztian Kasa
> Priority: Major
>
> {code}
> create table r_table (
> string_col varchar(30)
> );
> create table l_table (
> string_col varchar(14)
> );
> insert into r_table VALUES ('AAA111');
> insert into l_table VALUES ('AAA111');
> SELECT l_table.string_col from l_table, r_table
> WHERE r_table.string_col = l_table.string_col AND l_table.string_col IN
> ('AAA111', 'BBB222') AND r_table.string_col IN ('AAA111', 'BBB222');
> {code}
> Should give one row
> {code}
> AAA111
> {code}
> but it returns empty rs
> Workaround
> {code}
> set hive.optimize.point.lookup=false;
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)