[ 
https://issues.apache.org/jira/browse/HIVE-27264?focusedWorklogId=857080&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-857080
 ]

ASF GitHub Bot logged work on HIVE-27264:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Apr/23 14:17
            Start Date: 14/Apr/23 14:17
    Worklog Time Spent: 10m 
      Work Description: kasakrisz opened a new pull request, #4237:
URL: https://github.com/apache/hive/pull/4237

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: 
https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., 
'[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a 
faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   Consider two `RexLiterals` to be equal if they has the same value and sql 
type even if the precision in `HivePointLookupOptimizerRule`
   
   ### Why are the changes needed?
   If such literals are considered to be different the new expression created 
by the rule
   from
   ```
   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"))
   ```
   is
   ```
   AND(IS NULL($0), null)
   ```
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. Queries affected produce results.
   
   ### How was this patch tested?
   ```
   mvn test -Dtest.output.overwrite -Dtest=TestMiniLlapLocalCliDriver 
-Dqfile=pointlookup6.q -pl itests/qtest -Pitests
   mvn test -Dtest=TestHivePointLookupOptimizerRule -pl ql
   ```




Issue Time Tracking
-------------------

            Worklog Id:     (was: 857080)
    Remaining Estimate: 0h
            Time Spent: 10m

> 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
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {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)

Reply via email to